[pycrypto] Base64 encoded output differs from pycrypto and as3crypto libraries.

Thorsten Behrens sbehrens at gmx.li
Wed Jan 12 14:59:38 CST 2011


I've added Schneier's CBC test vector to our test suite. We succeed. 
Here's the vector as it looks in our code:

     # chaining mode (CBC) test data
         'Blowfish CBC mode test vector',
         dict(mode='CBC', iv=b('fedcba9876543210'))),

And here it is as presented by Schneier:

chaining mode test data
key[16]   = 0123456789ABCDEFF0E1D2C3B4A59687
iv[8]     = FEDCBA9876543210
data[29]  = "7654321 Now is the time for " (includes trailing '\0')
data[29]  = 37363534333231204E6F77206973207468652074696D6520666F722000
cbc cipher text
cipher[32]= 6B77B4D63006DEE605B156E27403979358DEB9E7154616D959F1652BD5FF92CC

He pads the data[29] with three more \0 at the end to get to 32.

Can you run that test vector against your library and see how it behaves?


More information about the pycrypto mailing list