[SalesForce] How decrypt MD5

I'm try decrypt one string in format MD5 but I have not been able, this the code:

String e = 'test@testcom';
Blob b = Crypto.generateDigest('MD5', Blob.valueOf(e));
String result = EncodingUtil.convertToHex(b);
Blob b2 = EncodingUtil.convertFromHex(result);
String e2 = EncodingUtil.base64Encode(b2);

Best Answer

By it's very nature you cannot decrypt MD5. It's a one way hash algorithm. There are some sites that claim to decrypt certain phrases but all they do is store known phrases to return them.


Md5 (Message Digest 5) is a cryptographic function that allows you to make a 128-bits (32 caracters) "hash" from any string taken as input, no matter the length (up to 2^64 bits). This function is irreversible, you can't obtain the plaintext only from the hash. The only way to decrypt your hash is to compare it with a database using our online decrypter.

Related Topic