encryption mobile questions/problem - Blowfish

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cusingerBUSCw5N
Posts: 339
Joined: Wed Jul 11, 2012 9:24 pm

encryption mobile questions/problem - Blowfish

Post by cusingerBUSCw5N » Thu Nov 28, 2013 1:14 am

I am trying to encrypt data going between a mobile device and a server. I have two questions on encryption. First - is it supported on mobile devices? According to the dictionary, it says encrypt for servers...

If it isn't supported, then how is data protected going from a mobile device to a server and back?

If it is supported, then I have another question. I have downloaded the Blowfish and UTF stack and it's quite lovely. Unfortunately, the encryption is different than encryption produced by java.

My example:
the key is:something
the words to encrypt: whatever is the problem

On the Livecode stack, it creates:
DB0A9D1FB6A40952723121A1AC655CF810964B21EDD7F7E4

In java (and Cold Fusion), it creates:
0AF97CF2FA6D1C7AD2877CD0EF26DC45673145F2C8497B44

no match...

The javacode is:
<cfset Cipher = createObject("java", "javax.crypto.Cipher")>
<cfset encryptor = Cipher.getInstance("Blowfish/ECB/pkcs5padding")>
<cfset keySpec = createObject("java", "javax.crypto.spec.SecretKeySpec").init(plainKey.getBytes(), "Blowfish")>
<cfset encryptor.init(Cipher.ENCRYPT_MODE, keySpec)>
<cfset encryptedTextFromJava = encryptor.doFinal(myText.getBytes())>
<cfset javaEncrypted = BinaryEncode(encryptedTextFromJava, "HEX")>

...so it uses HEX...and pkcs5padding....

I can't figure out what the Blowfish and UTF stack uses....
so I can't figure out how to match it on the other end.

Also, the basic Livecode encryption creates a bigger difference... when I do

on mouseUp
get "whatever is the problem"
encrypt it using "blowfish" with "something"
answer it
end mouseUp

I get a bunch of crazy letters...(I believe it doesn't convert it to binary)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”