First of all,theres no need to make this at client side. This type of operations are performed at server side.
Second thing is that,you should make use of algorithm that are irreversible in nature,that is decrypted value cant be reverted back to its original form.Theres wonderful article available for this by one of our valuable member OriginalGriff.
Password Storage: How to do it.[
^]
Further,theres no need to make use of onBlur() etc. event,as you will have login button than perform the desired operations there only.Refer to below links.
How To: Hash Data Using MD5 and SHA1[
^]
A Beginner's Tutorial for Understanding and Implementing Password Hashing and Salting[
^]
The Art & Science of Storing Passwords[
^]
Regards.. :laugh: