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