Rijndael encrypt
Posted: Sat Mar 14, 2009 9:23 am
Hi,
I have search in the forum a free code source of "rijndael encrypt" but all link for download lib or example are down.
I search to convert this C++ code to PureBasic.
Can u help me ?
Thx
I have search in the forum a free code source of "rijndael encrypt" but all link for download lib or example are down.

I search to convert this C++ code to PureBasic.
Can u help me ?
Thx
Code: Select all
m_AES.SessionKey((unsigned char *)REGISTRYKEY);
void CSettings::AESEncrypt(Buffer *in, Buffer *out)
{
Buffer t;
char buff[16];
char *packet = in->Ptr();
int len = in->Len();
in->Append("\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16);
// let's determine size
int j = len%16;
int o = 0;
While (o<len)
{
m_AES.rijndael_encrypt(&m_AES.myaes.enc, (unsigned char *)packet, (unsigned char *)buff);
packet += 16;
o += 16;
t.Append(buff, 16);
}
in->ConsumeEnd(16);
// now convert it To HEX
ToHex(&t, out);
out->Append("\0",1);
out->ConsumeEnd(1);
}