[erlang-questions] blowfish CFB mode in Crypto application

Sverker Eriksson sverker.eriksson@REDACTED
Thu Jun 5 16:36:19 CEST 2014


On 05/30/2014 08:47 AM, Igor Nesterov wrote:
> Hi,
>
> I'm using block_encrypt function from crypto application with blowfish 
> cipher in CFB mode and find that block_encrypt doesn't allow to 
> continue sequential encryption in this mode.  Underlying 
> BF_cfb64_encrypt function changes parameters iv and num, so they can 
> be passed to the next call.And bf_cfb64_crypt from C part of crypto 
> application doesn't pass those parameters back to erlang side, so it's 
> impossible to obtain new parameters for the new call. Is there another 
> solution exists? Or it's better to make patch?

There is an interface for streaming encrypt/decrypt:

crypto:stream_init/2/3
crypto:stream_encrypt/2
crypto:stream_decrypt/2

A patch that adds blowfish mode to this interface is the solution I think.


/Sverker, Erlang/OTP




More information about the erlang-questions mailing list