curie-cipher
v0.0.7
Published
A library for encryption and decryption, that works both for the browser and the server
Downloads
17
Maintainers
Readme
curie-cipher
A library for encryption and decryption, that works both for the browser and the server.
Installation
Requirements:
- Node.js
- npm (Node.js package manager)
Use the package manager npm to install curie-cipher.
npm install curie-cipher
Usage
import { encrypt, decrypt } from 'curie-cipher'
encrypt("secretKey", "message", "algorithm") # returns an object containing the iv and encrypted data
decrypt("secretKey", "data", "iv", "algorithm") # returns the decrypted data as a string
# algorithm is optional and defaults to aes-128-cbc
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.