How to send password to server using vue or javascript?

It is not really need to encrypt the password in your javascript code. It is more important to serve your PHP on a HTTPS server.

The data sending between browser and your web server will be encrypted by the SSL/TLS cert.

Here are some guides to setup a HTTPS enabled web server, I assume your php is hosted on NGINX or Apache with php-fpm or apache php modules.

With letsencrypt, it provides a free SSL/TLS cert for your web server to secure the communication between client browser and itself.

  • https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
  • https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-16-04