Hi, i am new in this encoding decoding stufs and i have some problem. I work on VS 2012 ASP.NET c#. My problem is that i need to create CheckSum value from some input string. The length of the CheckSum need to be 16 bytes (32 characters) long like this one: "8A303F3E0CB4F8A9CDA5AC120F9B90A4". The encryption need to be done using a pass key for example TEST_PASS and this key will be used latter to be decrypted this hash value.... hope you understand what i ask and what i need pls help me
Look again at the specs for encryption/decryption. That looks trather like a multistep step procedure: - user enters password - system generates salt - system generates hash from salted password and derives both CheckSum and actual password for encryption - system stores salt and CheckSum in the encrypted file - system encrypts input file with the actual password generated above. When you want to decrypt the file, you can check the password by calculating the CheckSum. The decrpytion algorithm might work with a wrong password too, just producing a nonsense output...
First, MD5 is a cryptographics HASH, NOT an encryption.
Second, it's a ONE-WAY hash. There is no such thing as "decrypting a hash". In theory, you cannot get the original content back from a hash value.
Lastly, MD5 is considered broken and should no longer be used in production code. It just doesn't take that much computing power to break it in todays world. Also, two different pieces of content CAN produce the same hash value using MD5!
Use something a bit stronger, like SHA512 instead and use proper salting techniques to make it even harder to break.