Page 1 of 1

encryption mobile questions/problem - Blowfish

Posted: Thu Nov 28, 2013 1:14 am
by cusingerBUSCw5N
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:

In java (and Cold Fusion), it creates:

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")> 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)