hOpenPGP-3.0.1.1: native Haskell implementation of OpenPGP (RFC9580)
Safe HaskellNone
LanguageHaskell2010

Codec.Encryption.OpenPGP.CFB

Synopsis

Documentation

encryptOpenPGPCfbRaw Source #

Arguments

:: forall (mode :: OpenPGPCFBMode). OpenPGPCFBModeW mode 
-> SymmetricAlgorithm 
-> IV 
-> ByteString

plaintext (with MDC trailer already appended)

-> ByteString

raw session key bytes

-> Either CipherError ByteString 

mdcTrailerForSEIPDv1 :: IV -> ByteString -> ByteString Source #

Compute the MDC trailer appended to SEIPDv1 plaintext before encryption. The trailer is: 0xd3 0x14 SHA1(nonce || plaintext || 0xd3 0x14).

seipdv1NonceFromIV :: IV -> ByteString Source #

The SEIPDv1 nonce: the IV bytes followed by its last two bytes (resync prefix).

validateSEIPD1MDC :: ByteString -> ByteString -> Either String ByteString Source #

Verify the MDC trailer of a decrypted SEIPDv1 payload. Takes the CFB nonce (blockSize+2 prefix bytes retained from decryption) and the full decrypted bytes (payload + MDC packet), and returns the payload without the MDC trailer on success.