Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Go Back   Code Forums > Application and Web Development > MS Technologies ( ASP, VB, C#, .NET )
User Name
Password

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 03-14-2006, 12:48 AM   #1 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
Decrypt MD5

Can you Decrypt MD5 in c#. It's a difficult problem. Plz help me
__________________
khanhlq is offline  
Old 03-14-2006, 04:43 AM   #2 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
Why and what you need to decrypt ?
__________________
DJMaze is offline  
Old 03-14-2006, 02:20 PM   #3 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
in general no. yoou just take something you think is equivalent, generate the MD5 hash of that, and compare that with your original MD5. If they match you know what was encrypted.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline  
Old 03-14-2006, 02:32 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
I like DJM's question I am curious.
__________________
sde is offline  
Old 03-14-2006, 03:41 PM   #5 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
Example I encrypt by:
Quote:
private string encryptString(string strToEncrypt)
{
System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding();
byte[] bytes = ue.GetBytes(strToEncrypt);

// encrypt bytes
System.Security.Cryptography.MD5CryptoServiceProvi der md5 = new System.Security.Cryptography.MD5CryptoServiceProvi der();
byte[] hashBytes = md5.ComputeHash(bytes);

// Convert the encrypted bytes back to a string (base 16)
string hashString = "";

for(int i=0;i<hashBytes.Length;i++)
{
hashString += Convert.ToString(hashBytes[i],16).PadLeft(2,'0');
}

return hashString.PadLeft(32,'0');
}
Now i want decrypt the password, but i can't write the best code. Please help me.
__________________
khanhlq is offline  
Old 03-14-2006, 03:52 PM   #6 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Just store the encrypted password, and when you ask the user again for the password, encrypt it with the same process. If the encrypted strings match, they entered the same password.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline  
Old 03-14-2006, 04:08 PM   #7 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
Have other way ? The way of teknomage1 same banana
__________________
khanhlq is offline  
Old 03-14-2006, 04:15 PM   #8 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
Quote:
Originally Posted by sde
I like DJM's question I am curious.
hehehe same frequencies

As tekno said: encrypt again
__________________
DJMaze is offline  
Old 03-14-2006, 06:16 PM   #9 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 595
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
same banana?
__________________
Stop intellectual property from infringing on me
teknomage1 is offline  
Old 03-14-2006, 08:25 PM   #10 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
lol, banana

khanhlq: you can not decrypt md5. it is one-way encryption.
__________________
sde is offline  
Old 03-16-2006, 12:09 AM   #11 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
Quote:
Just store the encrypted password, and when you ask the user again for the password, encrypt it with the same process. If the encrypted strings match, they entered the same password.
Send me the code and i'll try it and i found the lost pass. The pass use in database, i can see it(encrypted) but i don't remember the actual of pass.
__________________
khanhlq is offline  
Old 03-16-2006, 12:18 AM   #12 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,397
sde is on a distinguished road
if you have access to the database, why don't you just md5 a new pass, and paste the encrypted string in the database so you know what your pass is.
__________________
sde is offline  
Old 03-16-2006, 12:27 AM   #13 (permalink)
khanhlq
Registered User
 
Join Date: Mar 2006
Posts: 7
khanhlq is on a distinguished road
But i want write a programme descrypt. Somebody written, plz send me. Thanks
__________________
khanhlq is offline  
Old 03-16-2006, 04:07 AM   #14 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 635
DJMaze is on a distinguished road
time to lock this thread?
__________________
DJMaze is offline  
Old 03-16-2006, 06:29 AM   #15 (permalink)
redhead
Newbie
 
redhead's Avatar
 
Join Date: Jun 2002
Location: Denmark
Posts: 1,680
redhead is on a distinguished road
Done and done, since theres no way to decipher something that is a one way encryption, plus, the only place I could see use for something like that, would be in a direction towards password cracking, which we don't approve of here at Code Newbie.
__________________
Don't worry Ma'am, We're university students, We know what We're doing.
-----
If you pull the pin, Mr.Grenade would no longer be your friend.
-----
01000111 01101111 00100000 01000011 00100000 00100001
redhead is offline  
Closed Thread


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
un md5 a md5 hash? falsepride PHP 16 07-04-2005 08:49 AM
MD5 Ecrypt with Java sde Java 6 07-20-2004 06:05 AM


All times are GMT -8. The time now is 04:12 AM.


Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle