Solved

How to decrypt using MD5Crypto

Posted on 2013-01-29
3
352 Views
Last Modified: 2013-01-30
How can I decrypt a string which uses the folowing code to encrypt a string :

public static string HashResetParams(string username, string guid)
        {
            byte[] bytesofLink = System.Text.Encoding.UTF8.GetBytes(username + guid);
            System.Security.Cryptography.MD5 md5 = new  System.Security.Cryptography.MD5CryptoServiceProvider();
            string HashParams = BitConverter.ToString(md5.ComputeHash(bytesofLink));
            return HashParams;
        }
0
Comment
Question by:brgdotnet
  • 2
3 Comments
 
LVL 19

Expert Comment

by:Rikin Shah
ID: 38833822
Hi,

You want to decrypt MD5 encrypted string which is not possible. MD5 is a non decrypt-able cryptography type.

There are some websites which runs on database for some standard passwords people use to keep (like, 123456, abc123). In that case it can be useful to you to decrypt. In case your password is not simple (like, askjdh122?) the website would not be useful.
0
 
LVL 2

Author Comment

by:brgdotnet
ID: 38833947
When a user registers to my site for the first time, I send them an email message with a unique guid. Then when they click on a link in the email message, they are redirected back to a web page which ask them to confirm their identity. The guid is stored in the query string, where I check it, against it's previously saved value in the database.

So is it senseless for me to encrypt the guid? Guids are fairly cryptic as is? Just thought I would go the extra mile to convulute the password further so no hacker could access it.

What encryption should I use, if encrypting it does make sense?
0
 
LVL 19

Accepted Solution

by:
Rikin Shah earned 200 total points
ID: 38834000
Well, you are on the right track... MD5 is your choice.

Yes Guids are... but for your extra mile you can encrypt it. And when you want to compare the Guids entered by the user while the redirection, the user entered Guid will be encrypted and compared to the encrypted one in the database.

Or you can send the encrypted Guid string right away to the user and ask the user to enter it while confirming the registration. In this case you will not have to encrypt the Guid to compare against the encrypted string in the database.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Firing an ASP.NET event on selection of a JQuery datepicker 4 31
Sort GridView by ID Descending 1 17
abstract class C# 1 31
Adding items to a C# list incrementally 5 35
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question