Should I encrypt login password on Javascript or on backend?
<p>I have a small website using Html,Css,Javascript and PhP. The website contains a basic login page where the user has to enter his password. Said password is then sent to php, which in its turn, encrypts it using SHA-512 and adds it to database.</p>

<p>So I started wondering. Is this the preferred way of doing things? I thought that it might be better if I encrypt the password using javascript and send it to php when it is already encrypted. At least that way, the original password wouldn't be inside a POST request.</p>

<p>But is that really the right way? Isn't it bad if anyone can see what kind of encryption I'm using?</p>