Re: Rer: Decrypt problem on Windows solved

2020-12-22 Thread Bob Sneidar via use-livecode
I get a user entered password and encrypt it before storing it. It works cross 
platform. I suppose it would depend on what is in the original string. For 
instance option-v produces a checkmark on a Mac, but NOT on a PC and I assume 
Linux. Normal ASCII-256 characters should work fine.

Bob S


On Dec 14, 2020, at 2:56 PM, Neville Smythe via use-livecode 
mailto:use-livecode@lists.runrev.com>> wrote:

Could you try to textEncode the encrypted data before saving it in the
custom property, and then, in the other platform, textDecode it before
decrypting it?

Many thanks Panos, yes, that fixed the problem.

It never occurred to me that reading binary data from the custom properties of 
a stack should be treated with same caveat as downloading from an external 
source. Todays “learnings” (horrible newly fashionable word).

Neville Smythe

___
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


Rer: Decrypt problem on Windows solved

2020-12-14 Thread Neville Smythe via use-livecode
> Could you try to textEncode the encrypted data before saving it in the
> custom property, and then, in the other platform, textDecode it before
> decrypting it?

Many thanks Panos, yes, that fixed the problem.

It never occurred to me that reading binary data from the custom properties of 
a stack should be treated with same caveat as downloading from an external 
source. Todays “learnings” (horrible newly fashionable word).

Neville Smythe



___
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


Re: Rer: Decrypt problem on Windows

2020-12-14 Thread panagiotis merakos via use-livecode
Hello Neville,

Could you try to textEncode the encrypted data before saving it in the
custom property, and then, in the other platform, textDecode it before
decrypting it?

i.e. to do something like:

encrypt myData using myCipher with password myPass
put it into tEncryptedData
put textEncode(tEncryptedData, "native") into the cCustomProp of stack "foo"
...
...

and then, to decrypt it in the other platform:

put textDecode(the cCustomProp of stack "foo", "native") into tEncryptedData
decrypt tEncryptedData using myCipher with password myPass
put it into myOriginalData

Kind regards,
Panos
--

On Mon, 14 Dec 2020 at 12:43, Neville Smythe via use-livecode <
use-livecode@lists.runrev.com> wrote:

> The problem is platform-symmetric. That is, a string encrypted in LC on
> Windows will not decrypt on the Mac. Linux will not decrypt a string
> encrypted on the Mac, and presumably vice-versa.
>
> I did toy with the idea that the encryption keys might be device
> dependent, maybe the public and private keys created by the OpenSSL library
> were being stored in the OS somewhere. But no, a string encrypted on one
> Mac decrypts correctly on a different Mac. So my guess is that the keys are
> being stored by the different platform libraries within LC but not in a
> place known to the library for another platform.
>
> I believe this is a bug, that is to say, it is not what is intended;
> surely one should be able to store an encrypted string in an LC stack, and
> then any user with the password should be able to decrypt it.
>
> A workaround is to store a different encrypted string in the standalone
> compiled for each platform — but to do that you need to run LC on each
> platform, not exactly in the spirit of LC! Or not to use SSL encryption; I
> would assume all of the other ciphers available in OpenSSL would behave the
> same way.
>
> BTW thanks Mark for the suggestion about htppie, it does look cleaner and
> easier than curl. The disadvantage in my case is it would need to be
> installed in each user’s system.
>
> Neville Smythe
>
>
>
> ___
> 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
>
___
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


Rer: Decrypt problem on Windows

2020-12-14 Thread Neville Smythe via use-livecode
The problem is platform-symmetric. That is, a string encrypted in LC on Windows 
will not decrypt on the Mac. Linux will not decrypt a string encrypted on the 
Mac, and presumably vice-versa.

I did toy with the idea that the encryption keys might be device dependent, 
maybe the public and private keys created by the OpenSSL library were being 
stored in the OS somewhere. But no, a string encrypted on one Mac decrypts 
correctly on a different Mac. So my guess is that the keys are being stored by 
the different platform libraries within LC but not in a place known to the 
library for another platform.

I believe this is a bug, that is to say, it is not what is intended; surely one 
should be able to store an encrypted string in an LC stack, and then any user 
with the password should be able to decrypt it. 

A workaround is to store a different encrypted string in the standalone 
compiled for each platform — but to do that you need to run LC on each 
platform, not exactly in the spirit of LC! Or not to use SSL encryption; I 
would assume all of the other ciphers available in OpenSSL would behave the 
same way.

BTW thanks Mark for the suggestion about htppie, it does look cleaner and 
easier than curl. The disadvantage in my case is it would need to be installed 
in each user’s system.

Neville Smythe



___
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