Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET
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 20-Feb-13 15:35pm
Comments
Sergey Alexandrovich Kryukov at 20-Feb-13 21:43pm
   
Who told you it encrypts or decrypts anything?!
—SA
thekoko89 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
thekoko89 at 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 at 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 at 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 at 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 at 6-Mar-13 18:23pm
   
Ok my mistake miss understanding...
Sergey Alexandrovich Kryukov at 6-Mar-13 18:23pm
   
Great. Good luck.
—SA

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 725
1 OriginalGriff 385
2 CPallini 240
3 PIEBALDconsult 150
4 Magic Wonder 131
0 OriginalGriff 5,835
1 Sergey Alexandrovich Kryukov 5,198
2 CPallini 4,740
3 George Jonsson 3,167
4 Gihan Liyanage 2,470


Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 20 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100