954,551 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

password encryption (vb.net)

I am quite confused how to encrypt the password store in the database so that if the database found by pupil it cannot take password from the table .Anyone can show me how to encrypt password .I m using microsoft acess as the databese.


please help ....thx

mancode1007
Newbie Poster
13 posts since Nov 2007
Reputation Points: 10
Solved Threads: 0
 

>password encryption

You have to use/learn classes from System.Security.Cryptography namespace.

__avd
Posting Genius (adatapost)
Moderator
8,648 posts since Oct 2008
Reputation Points: 2,136
Solved Threads: 1,241
 

Hi use this for simple one

Public Function SimpleCrypt(ByVal Text As String)
        ' Encrypts/decrypts the passed string using 
        ' a simple ASCII value-swapping algorithm

        Dim strTempChar As String, i As Integer
        For i = 1 To Text.Length
            If Asc(Mid$(Text, i, 1)) < 128 Then
                strTempChar = _
          CType(Asc(Mid$(Text, i, 1)) + 128, String)
            ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
                strTempChar = _
          CType(Asc(Mid$(Text, i, 1)) - 128, String)
            End If
            Mid$(Text, i, 1) = _
                Chr(CType(strTempChar, Integer))
        Next i
        Return Text
    End Function
bhagawatshinde
Posting Whiz
315 posts since Sep 2010
Reputation Points: 21
Solved Threads: 22
 

Dear...

I also need this...

But where to use this code...?

Please help me to finish...

Thanks in advance...

Noorul Ariff
Light Poster
39 posts since Oct 2010
Reputation Points: 9
Solved Threads: 1
 

use in your textbox-
SimpleCrypt(txtpassword.text)

bhagawatshinde
Posting Whiz
315 posts since Sep 2010
Reputation Points: 21
Solved Threads: 22
 

Hi,

It's like adatapost said.
You need the System Security Cryptography class for it.
Look here.

Luc001
Posting Whiz
376 posts since Mar 2010
Reputation Points: 85
Solved Threads: 98
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You