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

>password encryption

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

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
commented: Bad advice )-: -2

Dear...

I also need this...

But where to use this code...?

Please help me to finish...

Thanks in advance...

use in your textbox-
SimpleCrypt(txtpassword.text)

Hi,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.