blowfish ECB implementation in erlang?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

blowfish ECB implementation in erlang?

Larry Ogrodnek-2
Hi, I'm wondering if anyone has put together an implementation of blowfish ECB?

thanks.

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Reply | Threaded
Open this post in threaded view
|

Re: blowfish ECB implementation in erlang?

Richard Andrews-5
On Thu, Sep 24, 2009 at 5:33 AM, Larry Ogrodnek <[hidden email]> wrote:
> Hi, I'm wondering if anyone has put together an implementation of blowfish ECB?

No. But I did one for AES256 not long ago. The pattern in the crypto
driver is pretty simple to extend.

________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

Reply | Threaded
Open this post in threaded view
|

Re: blowfish ECB implementation in erlang?

Paul Oliver-2
In reply to this post by Larry Ogrodnek-2
On Wed, Sep 23, 2009 at 8:33 PM, Larry Ogrodnek <[hidden email]> wrote:

> Hi, I'm wondering if anyone has put together an implementation of blowfish
> ECB?
>
> thanks.
>

Hi Larry,

Check the following page for the patch that added cfb64.

http://www.nabble.com/Patch-to-add-Blowfish-cfb64-to-crypto-app-td24232164.html

You should almost be able to copy this verbatim to add ecb.

Cheers,
Paul.
Reply | Threaded
Open this post in threaded view
|

Re: blowfish ECB implementation in erlang?

Paul Oliver-2


On Fri, Sep 25, 2009 at 1:19 PM, Paul Oliver <[hidden email]> wrote:
On Wed, Sep 23, 2009 at 8:33 PM, Larry Ogrodnek <[hidden email]> wrote:
Hi, I'm wondering if anyone has put together an implementation of blowfish ECB?

thanks.

Hi Larry,

Check the following page for the patch that added cfb64.

http://www.nabble.com/Patch-to-add-Blowfish-cfb64-to-crypto-app-td24232164.html

You should almost be able to copy this verbatim to add ecb.

Cheers,
Paul.

Hi Larry,

The attached patch should do ECB for you.  It works for me on the test data I obtained from http://www.schneier.com/code/vectors.txt.

puzza@imac:~/Downloads/otp_src_R13B02-1$ /tmp/bin/erl
Erlang R13B02 (erts-5.7.3) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]

Eshell V5.7.3  (abort with ^G)
1> %% FEDCBA9876543210 == Key = <<254,220,186,152,118,84,50,16>>
1> %% 0123456789ABCDEF == Clear = <<1,35,69,103,137,171,205,239>>
1> %% 0ACEAB0FC6A0A28D == Enc = <<10,206,171,15,198,160,162,141>>
1>
1> crypto:start().
ok
2> Key = <<254,220,186,152,118,84,50,16>>.
<<254,220,186,152,118,84,50,16>>
3> Clear = <<1,35,69,103,137,171,205,239>>.
<<1,35,69,103,137,171,205,239>>
4> Enc = <<10,206,171,15,198,160,162,141>>.
<<10,206,171,15,198,160,162,141>>
5> Enc == crypto:blowfish_ecb_encrypt(Key, Clear).
true
6>  Clear == crypto:blowfish_ecb_decrypt(Key, Enc).
true
7>

I'm off on holiday tomorrow so if it doesn't work as it should I'll take another look in a couple of weeks.  ;}  If it works OK please reply and perhaps it can be picked up in a future OTP release.

Cheers,
Paul.


________________________________________________________________
erlang-questions mailing list. See http://www.erlang.org/faq.html
erlang-questions (at) erlang.org

0001-Blowfish-ECB.patch (5K) Download Attachment