node-anubis-cipher
nodejs module for the anubis 256 bit cipher in cbc mode with optional hmac authentication.
Installation
npm
$ npm install node-anubis-cipher --save
git
$ git clone git@github.com:angeal185/node-anubis-cipher.git
//default options iv: random // {string} 16 byte string encryption iv iterations: 10000 //~ {integer} pbkdf2 iterations pbkdf2: false //~ {boolean} run password through pbkdf2 salt: undefined//~ {string} pbkdf2 salt - must be set if using pbkdf2 mac: false //~ {boolean/string} add hmac authentication // false to disable or string to be used for secret hash: 'sha512' //~ {boolean/array} hash used for hmac and pbkdf2 buffer: false // {boolean/array} add/strip padding to both ends // false to disable or an array for true. // [1,2] would prepend/slice 1 byte and // append/slice 2 bytes /** * sync * @param * @param * @param **/ //encrypt anubis //decryptanubis /** * callback * @param * @param * @param * @param **/ //encryptanubis //decryptanubis /** * promise * @param * @param * @param **/ //encrypt anubis //decryptanubis //demo const anubis = ; { let key = 'test'; let options = pbkdf2: true salt: 'salt' iterations: 10000 mac: 'secret' buffer: 12 // callback console anubis //sync console let syncEnc = anubis; console let syncDec = anubis console ifsyncEncerr console else ifsyncDecerr console else console // promise console anubis }