<br><br><div class="gmail_quote">On Fri, Sep 25, 2009 at 1:19 PM, Paul Oliver <span dir="ltr"><<a href="mailto:puzza007@gmail.com">puzza007@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div class="gmail_quote"><div class="im">On Wed, Sep 23, 2009 at 8:33 PM, Larry Ogrodnek <span dir="ltr"><<a href="mailto:larry@bizo.com" target="_blank">larry@bizo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Hi, I'm wondering if anyone has put together an implementation of blowfish ECB?<br>
<br>
thanks.<br></blockquote></div><div><br>Hi Larry,<br><br>Check the following page for the patch that added cfb64.<br><br><a href="http://www.nabble.com/Patch-to-add-Blowfish-cfb64-to-crypto-app-td24232164.html" target="_blank">http://www.nabble.com/Patch-to-add-Blowfish-cfb64-to-crypto-app-td24232164.html</a><br>



<br>You should almost be able to copy this verbatim to add ecb.<br><br>Cheers,<br>Paul.<br></div></div>
</blockquote></div><br>Hi Larry,<br><br>The attached patch should do ECB for you.  It works for me on the test data I obtained from <a href="http://www.schneier.com/code/vectors.txt">http://www.schneier.com/code/vectors.txt</a>.<br>

<br>puzza@imac:~/Downloads/otp_src_R13B02-1$ /tmp/bin/erl<br>Erlang R13B02 (erts-5.7.3) [source] [smp:2:2] [rq:2] [async-threads:0] [kernel-poll:false]<br><br>Eshell V5.7.3  (abort with ^G)<br>1> %% FEDCBA9876543210 == Key = <<254,220,186,152,118,84,50,16>><br>

1> %% 0123456789ABCDEF == Clear = <<1,35,69,103,137,171,205,239>><br>1> %% 0ACEAB0FC6A0A28D == Enc = <<10,206,171,15,198,160,162,141>><br>1> <br>1> crypto:start().<br>ok<br>2> Key = <<254,220,186,152,118,84,50,16>>.<br>

<<254,220,186,152,118,84,50,16>><br>3> Clear = <<1,35,69,103,137,171,205,239>>.<br><<1,35,69,103,137,171,205,239>><br>4> Enc = <<10,206,171,15,198,160,162,141>>.<br><<10,206,171,15,198,160,162,141>><br>

5> Enc == crypto:blowfish_ecb_encrypt(Key, Clear).<br>true<br>6>  Clear == crypto:blowfish_ecb_decrypt(Key, Enc).<br>true<br>7><br><br>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.<br>

<br>Cheers,<br>Paul.<br>