androidmd5message-digest

Is MD5 guaranteed to be available for use with MessageDigest in Android?


I want to know if the MD5 digest algorithm is guaranteed to be available in all Android devices before I bluntly ignore the checked exception that MessageDigest.getInstance("MD5") can throw.


Solution

  • The Android JCE (Java Cryptography Extension) is based off the bouncycastle implementation but stripped down. bouncycastle provides a ton of different MessageDigests which can be found here.

    There's no guarantee that every Android device supports MD5 but it's extremely common and is likely to be on every device as it's supported in bouncycastle. If you want to know if the device supports MD5 you can check the algorithms the device supports. More on that is here.