Hello,
In C#,I'm using Blowfish.NET 2.1.3's BlowfishECB.cs file(can be found here)
In C++,It's unknown,but it is similiar.
In C++,the Initialize(blowfish) procedure is the following:
void cBlowFish::Initialize(BYTE key[], int keybytes)
In C#,the Initialize(blowfish) procedure is the same
public void Initialize(byte[] key, int ofs, int len)
This is the problem:
This is how the key is initialized in C++
DWORD keyArray[2] = {0}; //declaration
...some code
blowfish.Initialize((LPBYTE)keyArray, 8);
As you see,the key is an array of two DWORDS,which is 8 bytes total.
In C# I declare it like that,but I get an error
BlowfishECB blowfish = new BlowfishECB();
UInt32[] keyarray = new UInt32[2];
..some code
blowfish.Initialize(keyarray, 0, 8);
The error is:
Argument '1': cannot convert from 'uint[]' to 'byte[]'
What am I doing wrong?
Thanks in advance!