![]() |
Click here to advertise with us
|
|
|||||||
| Security Discussion on securing VB.NET applications, end-user configuration, application activation, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
I have a login page with username & password.I want the password to be encrypted while inserting into the database &decrypted while the user logins and check whether it is valid or not. can anyone give me the source code? Thanks, Swetha |
|
||||
|
You don't normally keep password as decryptable data, you use a one-way hash. Each time user enters a password you can hash it and compare with the original. That way there is 'no' way for unauthorized to get that information from your data.
Code:
Dim pass As String = "word" Dim sha As New System.Security.Cryptography.SHA1Managed Dim hash As String = Convert.ToBase64String(sha.ComputeHash(System.Text.Encoding.UTF8.GetBytes(pass)))
__________________
Some useful links: Learning videoes, Code Samples, WMI Code Creator, MSDN, The Code Project, WindowsClient.net, ASP.net, W3 Schools, Regular-Expressions.info, GDI+ FAQ
How to format posts with code blocks etc - present the problem/post properly ![]() |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|