Nexium Security

XOR

Encrypt/Decrypt with XOR Security

Import the NXor

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

Encrypt

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

Decrypt

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

On this page