Skip to content

Instantly share code, notes, and snippets.

@Smoenybfan
Last active November 1, 2019 15:35
Show Gist options
  • Save Smoenybfan/aa2182b22116585eb8c4b61522f655f8 to your computer and use it in GitHub Desktop.
Save Smoenybfan/aa2182b22116585eb8c4b61522f655f8 to your computer and use it in GitHub Desktop.
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