Nexium Security

Stream Cipher

Encrypt/Decrypt with Stream Cipher Security

Import the NStreamCipher

const { NStreamCipher } = require('nexium-security')

Encrypt

const input = '{"user":{"name":"John","age":30},"message":"Welcome!"}'
const key = 'mySecureKey'
const encrypted = NStreamCipher.encrypt(input, key)

Decrypt

const decrypted = NStreamCipher.decrypt<{ name: string }>(encrypted, key)

storeSecret

const key = 'mysecurekey'
const secret = 'SensitiveData'
const encryptedSecret = NStreamCipher.storeSecret(secret, key)

retrieveSecret

const decryptedSecret = NStreamCipher.retrieveSecret(encryptedSecret, key)

On this page