-
-
Save Smoenybfan/aa2182b22116585eb8c4b61522f655f8 to your computer and use it in GitHub Desktop.
This file contains 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
const FluentCrypto = require('./FluentCrypto'); | |
const key = FluentCrypto.generateSymmetricKeyFromPasswordFor('cipher', aes-128-cbc, process.env.PRIVATE_KEY) | |
let encrypter = FluentCrypto.Encryption() | |
.withCipher('aes-128-cbc') | |
.key(key) | |
.data('I came in first') | |
.data('and I came in second'); | |
let encrypted = encrypter.encrypt(); | |
//Later, Somewhere | |
let decrypted = FluentCrypto.Decryption() | |
.from(encrypter) | |
.data(encrypted) | |
.decrypt(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment