Hi,
I am writing a socket application using Nettalk. For security, I was thinking of Cryptonite suite (Capesoft) to use AES256 with IV and a preshared key. The intented clients are Android tablets and iPads connected on same network.
My issue is, whatever encryption options I choose, I’ll pass those info to my Android and iOS developers for them to implement in their respective platforms. The Interoperability between platforms is not working for me. The result produced by clarion app is different to that of the various online encryption tools.
Encryption option used in Cryptonite
Microsoft Enhanced RSA and AES Cryptographic Provided (FULL RSA AES)
Provider type = AES
Algorithm = AES256
SHA1 (for hashing the password)
Is there anyone out there who could point me into the right direction? I am open to alternative ideas too. Very urgent
I have used Cryptonite on a project that shared encryption between C# code and Clarion with success. It took a little work.
One trap I found for the interop in this scenario was byte order.
Encrypt RSA using OAEP:
encData = base64EncodedData
dataLen = Len(Clip(encData))
IF Crypto.EncryptA(Crypto.hExchangeKey, encData, dataLen, , cs:CRYPT_OAEP) <> Crypto:OK
! Deal with encryption failure
END
Str.SetValue(Sub(encData,1,dataLen))
Str.ReverseByteOrder()
Str.Base64Encode()
encData64 = Str.GetValue()
From memory that snippet was originally from the Cryptonite demo with adjustments to make it actually work in my particular scenario. The main point was the Str.ReverseByteOrder() which was needed to make it friendly to… well, the rest of the world. (Decrypting incoming encoded data obviously also needs the similar reverse magic) So if you have StringTheory then give that a go and if not then perhaps look at rolling your own ReverseByteOrder
There was other hassles related to certificate stores but it depends on the specifics of your implementation if that is even relevant so I won’t get into that just yet. See if the above helps!