zerobin-1.5.2: Post to 0bin services

Safe HaskellNone
LanguageHaskell2010

Web.ZeroBin.SJCL

Description

Encryption compatible with SJCL

>>> import Web.ZeroBin.SJCL
>>> import Data.ByteString.Char8
>>> encrypt "secret-word" (pack "hello")
Content {iv = "VxyuJRVtKJqhG2iR/sPjAQ", salt = "AhnDuP1CkTCBlQTHgw", ct = "cqr7/pMRXrcROmcgwA"}

Synopsis

Documentation

data Content Source #

Encrypted content. Each field is a toWeb-encoded byte-string

Constructors

Content 

Fields

encrypt Source #

Arguments

:: String

the password

-> ByteString

the plain data to encrypt

-> IO Content 

SJCL-compatible encryption function. Follows RFC3610 with a 8-bytes tag. Uses 16-bytes cipher key generated from the password and a random salt by PBKDF2-HMAC-SHA256 with 1000 iterations.