Unmodified copy of Google Code hosted CryptoJS project.
npm install cryptojslibCryptoJS
--------

This repo is straight unmodified-in-any-way copy of Google Code hosted CryptoJS project at https://code.google.com/p/crypto-js/ . This is hosted at github to add bower package so future updates can be managed better.
npm install cryptojslib
`
Using Bower:
`
bower install cryptojslib
`
$3
You can play with below code live at http://jsbin.com/IziHAdIf/1/edit?html,console.
Please see the Quick Start guide at https://code.google.com/p/crypto-js/#Quick-start_Guide
Below are very quick examples of core usage:
##### MD5
MD5 is a widely used hash function. It's been used in a variety of security applications and is also commonly used to check the integrity of files. Though, MD5 is not collision resistant, and it isn't suitable for applications like SSL certificates or digital signatures that rely on this property.
`
`
##### SHA-3
SHA-3 is the winner of a five-year competition to select a new cryptographic hash algorithm where 64 competing designs were evaluated.
`
`
##### Encoding and decoding
You can convert string to word arrays using various encoders. And word array in to string using decoders.
`
`
The UTF8 encoder/decoder is included in core.js and hence is available in rollup files for algorithms. However if you need UTF16 and Base64 encoder then you need to include corresponding file from components folder (see below for MD5 hash with Base64 example).
$3
CryptoJS does not have built-in support for AMD/RequireJS yet. However adding shims is almost trivial. For use with RequireJS, using files in components is probably more desirable instead of files in rollups folder because you probably already have setup RequireJS optimizer or other build process. To build the shim for RequireJS follow this steps:
- Identify algorithms and encoder/decoders you need.
- Look up relationship between components and rollups file here: https://code.google.com/p/crypto-js/source/browse/tags/3.1.2/builder/build.yml
- Write a shim for this relationship.
Here's the example: Let's say we want to use MD5 with Base64 encoder. The shim would look like this
`
require.config({
paths: {
'cryptojs.core': "path/to/cryptojslib/components/core.js",
'cryptojs.md5': "path/to/cryptojslib/components/md5.js",
'cryptojs.base64': "path/to/cryptojslib/components/enc-base64.js"
},
shim: {
'cryptojs.core': {
exports: "CryptoJS"
},
'cryptojs.md5': {
deps: ['cryptojs.core'],
exports: "CryptoJS" //You can also use "CryptoJS.MD5"
},
'cryptojs.base64': {
deps: ['cryptojs.core'],
exports: "CryptoJS" //You can also use "CryptoJS.enc.Base64"
}
}
});
``