Aes Encryption

Xbase++ 2.0 Build 554 or later
Post Reply
Message
Author
bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Aes Encryption

#1 Post by bobvolz »

I am trying to use Alaska's AESCrypt Class to encrypt a data string before sending it to my Vendor. My vendor has provided me with a key. The key is 32 characters long.

From what I am reading this key should generate 256 bit encryption (8X32) but it seems the oAES object that is created has a 128 bit blocklength.



I pass the raw data string cString to the below code.

cKey:="-J@NcRfUjXn2r5u8x/A?D(G+KbPdSgVk"
// create AesCrypt()-instance using the key
oAes := AesCrypt():new()
oAes:setkey(cKey)

// prepare input buffer length
oAes:prepareBuffer(@cString) //the result here is 4224 which is evenly divisable by 128 = 13

// encrypt buffer
cResult := oAes:encrypt(cString)

I do get an encrypted string returned (cResult) but I'm not sure if it is the needed encryption block length.

I'm really not sure what the correct thing to do here is. Does anyone have experience with AESCrypt that they can share?

Bob Volz

skiman
Posts: 1183
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: Aes Encryption

#2 Post by skiman »

Hi Bob,

I haven't used this encryption. I was wondering if you have checked the Chilkat Crypt2 module? There are some samples for aes. It is well documenten, maybe it gives you more info about the way of work. Or you can use Chilkat instead of the Xbase++ function.
Best regards,

Chris.
www.aboservice.be

Post Reply