I've written a very simple stack to encrypt or decrypt some text. There are two 
fields (In and Out) and two buttons (Encrypt and Decrypt). When I encrypt test 
in the IDE and then paste the encrypted text from the Out field to the In field 
and then decrypt it, I get the back the original text. But not in an OS X 
Standalone. From a few experiments, I suspect that the issue is related to 
displaying the encrypted text, probably an encoding issue.

I'm using LiveCode 6.5.2 under OS X 10.7.5

Here is my script:

local tData
local tDisplay
local tPassword
local tSalt
local tIV

on openStack
   put the sha1Digest of "My Old Password" into tPassword
   put "12345678" into tSalt
   put "1234567890123456" in tIV
end openStack

on encryptMSG
   put Field "In" into tData
   encrypt tData using "aes256" with password tPassword and salt tSalt and IV 
tIV
   put it into tDisplay
   delete char 1 to 16 of tDisplay
   put tDisplay into Field "Out"
end encryptMSG

on decryptMSG
   put Field "In" into tData
   decrypt tData using "aes256" with password tPassword and salt tSalt and IV 
tIV
   put it into Field "Out"
end decryptMSG

When I copy the encrypted text from the OS X standalone into a text editor (or 
even Mail), it displays differently (hence my suspicion that this is an 
encoding issue.

I appreciate any suggestions as to where I am going wrong.

Thanks

Peter 
http://LiveCode1001.blogspot.com

_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to