Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

This resource has not currently been approved, and is not currently linked to from our directory of resources. It is being displayed here for preview by the author and moderators only.
Rated
Read 2,078 times

Contents

Related Categories

General Functions ASP.Net with VB.Net - Password Encryption and Decryption

khari6579

Password Encryption and Decryption

    Public Function gfncPassword(ByVal strPassword As String, ByVal blnState As Boolean) As String
        Dim liTemp As Integer
        Dim liTemp1 As Integer
        Dim lzRetString As String

        If blnState = True Then ' Encrypt
            liTemp = Len(strPassword)
            lzRetString = ""

            For liTemp1 = 1 To liTemp
                lzRetString = lzRetString & Hex(Asc(Mid(strPassword, liTemp1, 1)))
            Next

            Return lzRetString

        Else 'Decrypt
            liTemp = Len(strPassword)
            lzRetString = ""
            For liTemp1 = 1 To liTemp Step 2              
                lzRetString = lzRetString & Chr(Convert.ToInt32(Mid(strPassword, liTemp1, 2), 16))
            Next
            Return lzRetString
        End If
    End Function

I am Hari, SSE in a Pvt Firm. I have knowledge in Dot Net, VB6, Visual Foxpro, Foxpro, SQL Server, Oracle, Access, DBase and Crystal Report.

Comments