Cryptography for Android AND iOS

I have looked on the coronalabs docs

http://docs.coronalabs.com/api/library/crypto/index.html

based on my understanding, it seems that crpyto.digest/hmac, will not work on Android, and digest will work for iOS, Are there any cryptography built in corona that can help me in encrypting strings?

The crypto.digest() and crypto.hmac() functions definitely do work on Android.  The algorithms supported such as MD5, SHA1, etc. vary between operations systems.  We’ve actually recently updated our documentation to indicate which algorithms are supported on which platforms and with which functions.  Have a look at our documentation here…

   http://docs.coronalabs.com/daily/api/library/crypto/md4.html

   http://docs.coronalabs.com/daily/api/library/crypto/md5.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha1.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha224.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha256.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha384.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha512.html

All right thanks for the heads up here :slight_smile: definitely a big help, got confused on the gotcha’s, but if I were to use 1 cryptography for both OS, what would you recommend?

Using MD5 or SHA1 with crypto.digest() is a popular choice.  These algorithms produce a smaller hash though, but that may be a good thing if you need to produce many hashes and you are concerned about performance.

SHA256, SHA384, and SHA512 are supported on all platforms that we currently support.  So, those might be convenient to use, but note that they produce much much larger hashses.  This is considered more secure, but at the cost of performance.

All right! thanks for spoon feeding, really it is a good help. b(^_^)d

The crypto.digest() and crypto.hmac() functions definitely do work on Android.  The algorithms supported such as MD5, SHA1, etc. vary between operations systems.  We’ve actually recently updated our documentation to indicate which algorithms are supported on which platforms and with which functions.  Have a look at our documentation here…

   http://docs.coronalabs.com/daily/api/library/crypto/md4.html

   http://docs.coronalabs.com/daily/api/library/crypto/md5.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha1.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha224.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha256.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha384.html

   http://docs.coronalabs.com/daily/api/library/crypto/sha512.html

All right thanks for the heads up here :slight_smile: definitely a big help, got confused on the gotcha’s, but if I were to use 1 cryptography for both OS, what would you recommend?

Using MD5 or SHA1 with crypto.digest() is a popular choice.  These algorithms produce a smaller hash though, but that may be a good thing if you need to produce many hashes and you are concerned about performance.

SHA256, SHA384, and SHA512 are supported on all platforms that we currently support.  So, those might be convenient to use, but note that they produce much much larger hashses.  This is considered more secure, but at the cost of performance.

All right! thanks for spoon feeding, really it is a good help. b(^_^)d