 |
| General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 12th, 2004, 02:37 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
decrypt a string converted by a php md5 algorithm?
how to decrypt a string converted by a php md5 algorithm in .net ?? i have to read the password field in database in order to make a login form in .net mobile application. the password is encrypted in md5 algorithm using php language. or... can i run a md5 function written in php language to decrypt the password from the .net application ?? or any other idea ??
|
|

August 12th, 2004, 01:01 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Usually when you are doing something like this, instead of decrypting the password you encrypt the one entered and see if the two encryptions match.
However, if you are actually trying to decrypt it, then you may need something else. I don't think that .NET has any description methods for md5.
|
|

August 12th, 2004, 04:06 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Peter is correct. MD5 is a one-way only encryption algorithm. With MD5, any given plain-text input will always result in the same output. So you certainly can use .Net to do it.
Look here for articles on it are located here:
http://aspnet.4guysfromrolla.com/articles/103002-1.aspx
Their example uses asp.net but I have used this in a windows application as well.
J
|
|

August 12th, 2004, 08:42 PM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thanks for the answers planoie and katsarosj. i've figured it out that the only way is comparing the 2 strings that have been encrypted. but i don't know how to make the encryption with md5 and whether the md5 algorithm exist in .net. thanks again!! especially for katsarosj for giving me the best solution.you're the best!! =}
|
|

August 12th, 2004, 11:01 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
I know that you can hash a password in the security namespace...
System.Web.Security.FormsAuthentication.HashPasswo rdForStoringInConfigFile("password", "md5")
I imagine if it's here, it might also be somewhere else. Of course, you could just use this method as it is.
|
|

August 13th, 2004, 02:26 AM
|
|
Authorized User
|
|
Join Date: Aug 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
there's still a problem..!! the .net md5 algorithm returns the result in array of bytes. while in my database, the password field is encrypted by the php md5 algorithm that returns the result in hexa. so if i want to compare both of the results, so how to convert the array of bytes to hexa in .net?? please helpp!! thx before ...
|
|

August 13th, 2004, 08:49 AM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
The next step is to convert the bytearray to a string then compare that string:
Convert.ToBase64String(yourByteArray)
I think that's what you're looking for, I hope it helps.
I HATE COMPUTERS!
|
|

April 19th, 2006, 04:57 AM
|
|
Registered User
|
|
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
here's the link to web site that offers md5 decryption
http://md5encryption.com/?mod=encrypt
|
|

September 15th, 2006, 06:51 AM
|
|
Registered User
|
|
Join Date: Sep 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I had also same problem .
Convert.ToBase64String(yourByteArray)
convert bytes to string .but when we compare with string that database had by PHP MD5 encryption is different as its is hexa type .so suggest any other solution.
please help me
|
|
 |