Hi Jules et al,
I’ve been looking at Juce’s BlowFish implementation, and have a little question Should all blowfish implementations yield the same results with the same input? I tried comparing the Juce BlowFish class with Paul Kocher’s implementation (from counterpane.com), and also libtomcrypt, but all three seemed to yield different results with the simple test of:
uint32 hi=0x123123;
uint32 lo=0x321321;
BlowFish bf((uint8*)"ABCDE", 5);
bf.encrypt(hi, lo);
sprintf(resultstring, "%X%X", hi, lo);
vs. (Paul Kochers):
uint32 hi=0x123123;
uint32 lo=0x321321;
BLOWFISH_CTX ctx;
Blowfish_Init (&ctx, (unsigned char*)"ABCDE", 5);
Blowfish_Encrypt(&ctx, (unsigned long*)&hi, (unsigned long*)&lo);
sprintf(resultstring, "%X%X", hi, lo);
Am I missing something, or should these yield identical results??!
Thanks!
graf.