Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 24th, 2005, 03:02 AM
Authorized User
 
Join Date: Dec 2004
Location: Chennai, TN, India.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kvanchi
Default Encryption and Decryption


hi
the code given in the link does only encryption
i also want to decrypt the password field when authenticating user while he logs in
*-------this is the code in the link--------------*
Imports System.Text

Imports System.Security.Cryptography



Module modEncrypt

  Public Function HashData(ByVal s As String) As String

    'Convert the string to a byte array

    Dim bytDataToHash As Byte() = _

     (New UnicodeEncoding()).GetBytes(s)



    'Compute the MD5 hash algorithm

    Dim bytHashValue As Byte() = _

    New MD5CryptoServiceProvider().ComputeHash(bytDataToHa sh)



    Return BitConverter.ToString(bytHashValue)

  End Function

End Module

*------------------------------------------------*
could u pls help me in decrypting the password field








Reply With Quote
  #2 (permalink)  
Old January 24th, 2005, 12:58 PM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think it's not possible,for md5

Reply With Quote
  #3 (permalink)  
Old January 24th, 2005, 02:52 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

The Hash you are creating is a one-way process. You can generate the hash from the original data, but cannot retrieve the original data from the hash.

To compare the password, use the same hashing mechanism on the password the user enters, and then compare the two hashes.

Alternatively, don't hash, but encrypt your data. Encrypted data can be decrypted again.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Die Interimsliebenden by Einstürzende Neubauten (Track 1 from the album: Tabula Rasa) What's This?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encryption/Decryption with rijndael ?!? vbmo Classic ASP Basics 3 November 17th, 2009 04:14 AM
Encryption/Decryption Problem param99 SQL Server 2000 4 December 14th, 2006 05:20 AM
Encryption & Decryption jvraman SQL Server 2000 1 June 22nd, 2006 02:48 AM
Encryption and Decryption kvanchi General .NET 1 February 2nd, 2005 02:04 PM
Encryption/Decryption using IUSR msrnivas General .NET 0 January 12th, 2005 12:35 AM



All times are GMT -4. The time now is 07:45 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.