Module

Node.Crypto.Cipher

#Cipher

data Cipher

https://nodejs.org/api/crypto.html#crypto_class_cipher

Usage:

buf <- Buffer.fromString "dummy" UTF8
pbuf <- Buffer.fromString "password" UTF8
sbuf <- Buffer.fromString "salt" UTF8
key <- Crypto.scryptSync pbuf sbuf 32
iv <- Buffer.fromString "iviviviviviviviv" UTF8
cip <- Cipher.createCipheriv "aes256" key (Just iv)
rbuf1 <- Cipher.update buf cip
rbuf2 <- Cipher.final cip
Buffer.concat [ rbuf1, rbuf2 ] >>= Buffer.toString Hex

Modules