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.
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