Wrox Programmer Forums
|
BOOK: ASP.NET Website Programming Problem-Design-Solution
This is the forum to discuss the Wrox book ASP.NET Website Programming: Problem - Design - Solution, Visual Basic .NET Edition by Marco Bellinaso, Kevin Hoffman; ISBN: 9780764543869
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET Website Programming Problem-Design-Solution 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 September 27th, 2005, 04:25 AM
Registered User
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Forgotten Password

i have read through the book and made the site running, but i could not find any way how to decrypt the password to send to the users who forgot their password.

there is a method EncryptPassword(ByVal password As String) As Byte() to encrypt the password and save into the database, however there is no DecryptPassword method when query the password from the database.

i would be very grateful if anyone knows how to decrypt the password.

many thanks

long
 
Old September 27th, 2005, 06:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The password isn't really encrypted - it's hashed. Hashing is like a one-way encryption. The idea was to be very secure so even site administrators could not see user's passwords.

You can only change their password and send them the new one.
 
Old September 27th, 2005, 07:36 AM
Registered User
 
Join Date: Sep 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

many thanks for your reply that gives me a good idea. also is there any way to query the password from the database and convert it to string?

many thanks

Long

long
 
Old September 28th, 2005, 06:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 917
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Assuming you read the password into a byte array named byteArray:

Convert to a string:

  string str = System.BitConverter.ToString(byteArray);

If you want a printable string with no wierd chars you can base64-encode it:

  string str = Convert.ToBase64String(byteArray);





Similar Threads
Thread Thread Starter Forum Replies Last Post
Forgotten VBA password myahsam Excel VBA 0 January 22nd, 2008 10:38 AM
Forgotten escape character chrscote Classic ASP Basics 4 December 4th, 2006 09:37 AM
Problem with Forgotten Password retrieval Insel Haber ASP.NET 2.0 Basics 1 October 18th, 2006 04:01 AM
Forgotten SQL sa password GeekyBern SQL Server 2000 2 August 5th, 2005 09:39 AM





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