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

2

8

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.

Erme answered 3/1, 2013 at 13:15 Comment(2)
If this is a new application and you need the hash for security, you should probably no longer use MD5 since its security is severely compromised.Fungi
I'm using MD5 to hash URLs for internal caching purposes only, no security concerns hereErme
G
5

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.

Galarza answered 3/1, 2013 at 15:21 Comment(0)
B
11

I'm getting java.security.NoSuchAlgorithmException: MessageDigest MD5 implementation not found on some devices. Here's the list:

GT-I8190
GT-I9100
GT-P3100
GT-S7562
HTC EVO 3D X515m
HTC Sensation 4G
HTC Sensation XL with Beats Audio X315b
LGL86C
LT22i
LT25i
LT26i
LT26ii
LT29i
SAMSUNG-SGH-I727
SGH-T769
SHV-E160K
SM-T211
ST21i
ST23i
ST26i
T7

and others.

This is statistics mainly for Indonesia though. The funny point is, the statistics is provided by Crittercism, and the exception is thrown by Crittercism too (looks like it uses MD5 in latest versions).

Bechler answered 28/11, 2013 at 15:14 Comment(0)
G
5

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.

Galarza answered 3/1, 2013 at 15:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.