-1

I need to encrypt my password using base 64. How can i do it in javascript?

Ian
  • 50,146
  • 13
  • 101
  • 111
Sivajith
  • 1,181
  • 5
  • 19
  • 38
  • 3
    Sivajith, Base-64 is an *encoding*, not *encryption*, scheme. It does not protect your passwords in any way. – Michael Petrotta Apr 06 '13 at 05:39
  • http://stackoverflow.com/questions/4121629/password-encryption-at-client-side if you are looking for encryption and not encoding – btevfik Apr 06 '13 at 05:45

1 Answers1

1

base64 is a method to encode data and not an encryption technique. If that is still the approach you want to take then here is a JavaScript library that will work: https://github.com/mshang/base64-js

There is also a built in method in Mozilla and web kit browsers called btoa():

https://developer.mozilla.org/en-US/docs/DOM/window.btoa

Jason Sperske
  • 29,816
  • 8
  • 73
  • 124