cryptonite-openssl-0.5: Crypto stuff using OpenSSL cryptographic library

LicenseBSD-style
Stabilityexperimental
PortabilityUnix
Safe HaskellNone
LanguageHaskell2010

Crypto.OpenSSL.AES

Description

Small Ad-Hoc bindings to AES-GCM encryption and decryption function.

Doesn't support incremental mode yet.

TODO: full fledge AES bindings (CBC, CTR, GCM...), with incremental processing.

Synopsis

Documentation

isSupportedGCM :: Bool Source #

Get whether the OpenSSL version linked supports GCM mode (at least 1.0.x and above)

encryptGCM Source #

Arguments

:: ByteString

Key

-> ByteString

IV

-> ByteString

Header (Authenticated input, will be not be copied to output)

-> ByteString

Plaintext to encrypt

-> ByteString

Encrypted input including the authentication tag (but not the header)

One shot function to GCM data without any incremental handling

decryptGCM Source #

Arguments

:: ByteString

Key

-> ByteString

IV

-> ByteString

Header (Authenticated input)

-> ByteString

Encrypted data

-> Maybe ByteString

Decrypted data if authentication successful

One shot function to decrypt GCM data without any incremental handling