[erlang-questions] aes_cfb_128_encrypt text length

Sverker Eriksson <>
Mon Jan 2 18:18:18 CET 2012

Monika Moser wrote:
> Hi,
> I have a question on the behavior of aes_cfb_128_encrypt as its
> implementation seems to have changed since version R12B-5
> Why does Text in *aes_cfb_128_encrypt(Key, IVec, Text) -> Cipher *have to
> be a multiple of 16 bytes?
> Though documentation told you, version R12B-5 did not enforce that it had
> to be a multiple of 16 bytes.
> While version R14A checks the length of Text and returns badarg.
> I thought that if you use CFB it was not necessary to use padding and
> decrypted data had just the same length as the input data.
> This restriction does not come from openssl or does it?
No, even though the openssl documentation is somewhat lacking, both the 
interface as the implementation of AES_cfb128_encrypt seems to be design 
to handle unaligned input.

I think it's a safe bet to supply a patch to remove that restriction. 
*wink wink*

/Sverker, Erlang/OTP

More information about the erlang-questions mailing list