I was happy to see the functions, not so happy with the documentation.
After doing a bunch of internet searching eventually I got the idea that picking a cipher was pretty much a personal preference because discovering the differences between ciphers requires more knowlege and research than I am willing to invest.
However it seemed that aes-128-gcm was considered very secure and not too time consuming.
Apparently aes-128-cbc has some issues with file size blocks or something that breaks it or some problem.
So I tried aes-128-gcm.
encrypt works fine. decrypt crashes. Livecode just says that there is an error, no details.
So I back off and use the cipher aes-128-cbc that is in the LiveCode dictionary.
That works.
So anybody know what the deal is with ciphers or is aes-128-cbc the only one we are allowed to use?
(all testing done on a Mac using LiveCode Indy 9.6.1 build 15522
Some additional info since original post.
aes-256-cbc works as a cipher too.
So maybe it is that aes-128-gcm is not implemented?
Love to hear about what ciphers others are using for encrypt/decrypt and why they picked the cipher they use.
Code: Select all
on mouseUp
local theData
local encData
local decData
local errMsg
put "abcdefghipklmnopqrstuvwxyz" into theData
encrypt theData using "aes-128-cbc" with password "test123"
put it into encData
put the result into errMsg
decrypt encData using "aes-128-cbc" with password "test123"
put it into decData
put the result into errMsg
--above code works just fine
encrypt theData using "aes-128-gcm" with password "test123"
put it into encData
put the result into errMsg
//all good so far, next line has some problem.
decrypt encData using "aes-128-gcm" with password "test123"
//above line fails with "execution error at line nn (32766), char 1
put it into decData
put the result into errMsg
end mouseUp