Page 1 of 1

Aes Encryption

Posted: Mon Apr 17, 2023 10:33 am
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

Re: Aes Encryption

Posted: Mon Apr 17, 2023 11:51 pm
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.