Last active
December 29, 2015 00:09
-
-
Save edewit/7584216 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| agCrypto.deriveKey('my password').then(function(rawPassword) { | |
| return agCrypto.getRandomValue(); | |
| }).then(function(generatedIV) { | |
| return agCrypto.encrypt({ | |
| IV: generatedIV, | |
| key: rawPassword, | |
| data: "My Bonnie lies over the ocean, my Bonnie lies over the sea" | |
| }); | |
| }).then(function(cipherText) { | |
| console.log(cipherText); | |
| }, function(error) { | |
| // there was some error. | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment