Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
Posted
Comments
Sergey Alexandrovich Kryukov 20-Feb-13 21:43pm    
Who told you it encrypts or decrypts anything?!
—SA
thekoko89 20-Feb-13 21:54pm    
i gess mabey they will not decrypt but will use the same TEST_PASS to compare those posted values...

1 solution

No! MD5 is cryptography thing, but its not for encryption or decryption. This is a cryptographic hash function:
http://en.wikipedia.org/wiki/Cryptographic_hash_function[^].

And as such, it is not good; it's strongly recommended not to use it for any cryptographic purposes: it's broken. Please see: http://en.wikipedia.org/wiki/Md5[^].

That's it. But check sum can be used for non-cryptographic purposes, but just as a check. This is what you probably need. So, everything you need is provided in .NET FCL:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx[^].

—SA
 
Share this answer
 
Comments
thekoko89 20-Feb-13 21:50pm    
my merchant service ask me to do this and generate a checksum usind MD5 with TEST_PASS :S so i realy need some code to do this its the only way
Sergey Alexandrovich Kryukov 20-Feb-13 21:58pm    
Who cares who asked you and why? I'm talking to you, not with "merchant service", because you asked us a question, not they. Don't you see that I answered?! What else is a problem? You have all you need.
If you can see it, please accept the answer formally (green button), if not — your follow-up questions are welcome.
—SA
thekoko89 20-Feb-13 22:03pm    
gess we understand each other i was trying to explain what exactly is my problem.... there is no need for fight... tnx for understanding i am in a bug pressure at the mom
Sergey Alexandrovich Kryukov 6-Mar-13 18:16pm    
Hope we do, I only don't understand what fight do you mean. I see no fight.
Good luck, call again.
—SA
thekoko89 6-Mar-13 18:23pm    
Ok my mistake miss understanding...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900