HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleHsOpenSSL-0.11.7.10Haskell2010

OpenSSL.Cipher

This module interfaces to some of the OpenSSL ciphers without using EVP (see OpenSSL.EVP.Cipher). The EVP ciphers are easier to use, however, in some cases you cannot do without using the OpenSSL fuctions directly.

One of these cases (and the motivating example for this module) is that the EVP CBC functions try to encode the length of the input string in the output (thus hiding the fact that the cipher is, in fact, block based and needs padding). This means that the EVP CBC functions cannot, in some cases, interface with other users which don't use that system (like SSH).

  • 2 types
  • 2 values
  • PackageHsOpenSSL-0.11.7.10
  • Exports4
  • LanguageHaskell2010
  • LicenceLicenseRef-PublicDomain
  • SourceCipher.hsc
valuenewAESCtx
  1. :: Mode

    For CTR mode, this must always be Encrypt

  2. -> ByteString

    Key: 128, 192 or 256 bits long

  3. -> ByteString

    IV: 16 bytes long

  4. -> IO AESCtx
#

Construct a new context which holds the key schedule and IV.

valueaesCBC
  1. :: AESCtx

    context

  2. -> ByteString

    input, must be multiple of block size (16 bytes)

  3. -> IO ByteString
#

Encrypt some number of blocks using CBC. This is an IO function because the context is destructivly updated.