Chilkat Email Components Home

Decrypt or Reverse a Hash (SHA-1, Digest-MD5, etc.)

Back

Question:
I have a client who is requesting for me to reverse the SHA-1 hex value to the original password of text that was used. Now it’s my understanding that SHA-1 is not reversible, but, I’ll ask the question anyway. Is there any undocumented function that I can use to decrypt SHA-1 using the Chilkat Crypt ActiveX or .NET versions?

Example code used to encrypt original text:

crypt.HashAlgorithm = "SHA-1"
crypt.EncodingMode = "hex"
encryptedStr = crypt.HashStringENC(s)

Answer:
Hashing is not the same as encryption. Hashing is the creation of a "digital fingerprint" of an arbitrary amount of data. The hash is a constant size (typically 16 bytes for example) whereas the amount of data hashed is limitless. You could hash 20 GB of data to create a 16-byte hash. Obviously, this is not reversible...

There is no source code associated with this article.