How to work with DES?
Stefan Matthias Aust
sma at 3plus4.de
Thu Feb 17 23:47:55 UTC 2000
Hi!
I was testing the code that was posted by Duane Maxwell on 8 Feb 2000
called DES.26.cs (I already deleted the original email, sorry).
I didn't build a pluggable primitive but want to use the Smalltalk code. I
think, the test method DES>>primPluginAvailable is wrong. Shouldn't it
fail with "^ false" ? After changing that, I could "cook" a key and
transform a block of bytes although it took me a moment to figure out that
#transform: will mutate the passed byteArray. I'd prefer a method that
returns the transformed object.
It seem also that DES class>>test2 doesn't work (Character doesn't
understands <<) because the test arguments are string and not byte arrays.
Finally and most important, I think the algorithm doesn't work. At least
for me it didn't work unless I modified the ByteBit variable to contain
#(1 2 4 8 16 32 64 128 )
instead of
#(128 64 32 16 8 4 2 1 )
I found this by comparing the Smalltalk algorithm with a working Java
implementation. Can anybody confirm that this is a problem?
bye
--
Stefan Matthias Aust // Bevor wir fallen, fallen wir lieber auf.
More information about the Squeak-dev
mailing list
|