Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| 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 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 March 6th, 2008, 03:09 AM
Authorized User
 
Join Date: Jan 2008
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default how i encrypt password and store it into database?

Hi..

please help me about this case.
i'm using VB NET (win form) and SQL Server 2000.
case is i want encrypt the password in Win Form and after that store it into my database (sql server) so it looks hash.
as for user want to log in, the win form will validate the password input with the database (sql server).

can anybody help me the code?

thanks in advance and last..

 
Old March 6th, 2008, 11:38 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The System.Web.Security.FormsAuthentication.HashPasswo rdForStoringInConfigFile method generates a hash in a couple different formats that you can use as your stored value. Even though it's in the web namespace you can still reference that from a windows form.

http://msdn2.microsoft.com/en-us/lib...onfigfile.aspx

This hash method is a one-way encryption. Store the hash result in the database. Then when you need to check the password, use the same method to hash what the user enters and compare the two hashed values. The only real side effect is that you can never retrieve the plain text password.

-Peter
peterlanoie.blog
 
Old March 9th, 2008, 10:26 PM
Authorized User
 
Join Date: Jan 2008
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I have found another way to encrypt it.

by the way thanks of ever thought to help me.

cheers,

thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to encrypt the Password or any string hanusoftware ASP.NET 2.0 Professional 0 July 16th, 2007 04:15 AM
Code to encrypt the Password or any string hanusoftware ASP.NET 2.0 Professional 1 July 10th, 2007 08:32 AM
Encrypt single column, where to store key wirerider ASP.NET 2.0 Professional 7 March 4th, 2007 11:09 PM
Need help password encrypt flyfish SQL Server 2000 9 July 12th, 2005 01:23 PM





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