Skip to content

Instantly share code, notes, and snippets.

@dacur
Created September 19, 2014 20:13
Show Gist options
  • Select an option

  • Save dacur/68c31255155f7408f1bc to your computer and use it in GitHub Desktop.

Select an option

Save dacur/68c31255155f7408f1bc to your computer and use it in GitHub Desktop.
Using CryptoJS to encrypt strings, e.g., passwords is as easy as adding the following lines of code to your app.
//add to your index page
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/md5.js"></script>
// add to your JS file, for instance, on a click 'submit' button
password = $('#password').val();
password = CryptoJS.MD5(password);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment