zym-chipper
v1.0.4
Published
Encrypts & decrypts text using salt.
Downloads
1
Readme
ZYM CHIPPER
yarn add zym-chipper
import { encrypt, decrypt, migrate } from 'zym-chipper';
const encrypted = encrypt('secret text', 'private secret');
decrypt(encrypted, 'private secret');
const newEncryption = migrate(encrypted, 'private secret', 'new private secret');
encrypt(data: string, salt?: string)
- encrypts data with optional passed salt.
decrypt(data: string, salt?: string)
- decrypts data with optional passed salt. Salt is required when encrypted with one.
enzym(data: string)
- encrypts data and returns it with ZYM! prefix.
dezym(data: string)
- if data has ZYM! prefix then decrypts it, if not then returns data back.
migrate(data: string, previuosSalt?: string, newSalt?: string)
- decrypts data then encrypts it again with new salt.