Encryption / Encoding Differences between IDE and OS X Standalone
Bill Vlahos
bvlahos at mac.com
Thu Feb 20 02:31:49 EST 2014
Peter,
I don’t know why it would be different in the IDE vs a standalone but I wouldn’t expect it to work correctly working with fields. There are limitations of what can be in a field.
I wrote the “Encryption Demo Stack” in RevOnLine that works both compiled and in the IDE. It puts the encrypted content into a custom property to avoid the problem you describe. You could take a look at it to see how it might be different from your stack.
I just tested it with LC 6.5.2 under 10.9.1 but it was written a long time ago so it should work fine in 10.7.
Bill Vlahos
_________________
InfoWallet (http://www.infowallet.com) is about keeping your important life information with you, accessible, and secure.
lcTaskList: (http://www.infowallet.com/lctasklist/index.htm)
RunRev lcTaskList Forum: (http://forums.runrev.com/viewforum.php?f=61)
On Feb 19, 2014, at 6:19 PM, Peter W A Wood <peterwawood at gmail.com> wrote:
> 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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list