Encrypting data for POST

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
PeterA
Posts: 1
Joined: Tue Mar 29, 2011 10:00 pm

Encrypting data for POST

Post by PeterA » Tue Mar 29, 2011 10:47 pm

Hi,
I am setting up a rev. server client system where data is encrypted using the SSL library in rev. I find that while simple URL encoded data can be posted to the server with no problem, if I run the data through the rev. Encrypt command (using blowfish) the data will not post properly to the server. When I call the data back from the server, it won't decrypt. It seems as if the data is being cut off randomly between the client and server machines. I set up a character count on the client, (after the encrypt), then count the characters at the server. They do not match, and the count at the server is random each time. If anyone has some insight on this It would be appreciated!

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Encrypting data for POST

Post by Mark » Mon May 09, 2011 4:00 pm

Hi PeterA,

It might be useful to send the data as multipart form data. Before posting it, encode it as base64. It might also be useful to replace all return chars (ASCII 10) in the base64 encoded data by a different character, e.g. a tab, and to urlEncode it. On the server, you'd have to urlDecode it, replace the tabs with returns and base64decode the data before decrypting it.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply