0.1.0 • Published 6 years ago

crypty v0.1.0

Weekly downloads
44
License
MIT
Repository
github
Last release
6 years ago

Crypty

A super simple (but secure) encryption and decryption of text using aes-256-cbc algorithm with a 32 bytes secret.

Important

By design the hash doesn't change at every encryptation, so don't use this lib to encrypt passwords.

Build Status sponsored by Taller


Install

npm i crypty

or

yarn add crypty

Usage

import { encrypt, decrypt } from 'crypty'

// Your secret must have 32 bytes.
const secret = 'P10PJY1ckcMEeZxWHfVzsiOktuXf8O8O'

const hash = encrypt('my text', secret)
// => 46e2a7e3214f127c198247332cdc89ce

const text = decrypt(hash, secret)
// => 'my text'

Disclaimer

Based on node-crypto-examples from @chris-rock.