0

My problem is revert operation encode .

String computedLtpaTokenMd5 = new String(Base64.encodeBase64(MessageDigest.getInstance("MD5").digest(ltpaToken.getBytes())));

how to recover the token ltpaToken by computedLtPaTOkenMD5?

quinz
  • 1,282
  • 4
  • 21
  • 33

1 Answers1

2

You cannot.

That is the whole point of a cryptographic hash function (which MD5 is, or rather was, you should not use it anymore): It is one-way.

All you can do is check if a given token matches that hashed value (by running the same hash function again and either getting the same output or not).


(You can reverse the Base64 encoding, but not the MD5 hashing)

Thilo
  • 257,207
  • 101
  • 511
  • 656