What is the best way to encrypt login details (use

2019-09-23 03:36发布

问题:

What is the best way to encrypt the login details (username and password) of any web based application using JavaScript at client side?

My requirement is to encrypt the username and password of the login page of the web application using JavaScript and this encrypted data needs to be used further at a later stage of the process.

Any help would be appreciable.

Regards...

回答1:

You should be encrypting login creds in your backend.

I recommend Crypto-js. There are instructions for both client side and server side.



回答2:

Client side: you can use some of the functionality of crypto-js. Also, you will most likely not be able to use it later on because while encrypting, a "salt" would be added to your variable and hashed together with it - rendering it a compare only value (using the hash comparing function)

It is advisable to encrypt data on your back-end though.