I have a client who needs us to use Blowfish ECB encryption with cipherMode 0, output 1. I have tried to solve for this, but I'm getting stuck. How do I fix my code?
Here are the full client instructions:
Algorithm: Blowfish ・ Mode: ECB ・ Padding: PKCS5Padding *Initial vector is unnecessary because we use ECB mode.
Example ・Encrypt Key: 2fs5uhnjcnpxcpg9 → Plain Text : 3280:99:20120201123050 → Cipher Text : daa745f1901364c0bd42b9658db3db96336758cd34b2a576 * Please keep Cipher Text with 16 hexadecimal characters . * Please generate Cipher Text without “salt”.
I need to write this in C#. Here's what I did, but it doesn't seem to be working:
string member_id = "3280";
string panelType = "99";
string RandomString = "20120201123050";
string encryptionKey = "2fs5uhnjcnpxcpg9";
string cryptstr = member_id + ":" + panelType + ":" + RandomString;
string plainText = cryptstr;
BlowFish b = new BlowFish(encryptionKey);
string cipherText = b.Encrypt_ECB("3280:99:20120201123050");
The result is not daa745f1901364c0bd42b9658db3db96336758cd34b2a576. Where did I go wrong?