Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
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
Old January 24th, 2005, 03:02 AM
Authorized User
Join Date: Dec 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to kvanchi
Default Encryption and Decryption

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

Old January 24th, 2005, 12:58 PM
Authorized User
Join Date: Jul 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts

I think it's not possible,for md5

Old January 24th, 2005, 02:52 PM
Imar's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

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.


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?

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

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