borderAndreaVB free resources for Visual Basic developersborder
AndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 Andrea Tincani
:: Encrypt/Decrypt Your Password

Author  

Cucum

Language  

VB5, VB6

Operating Systems  

Windows 95, 98, NT, 2k, Me and XP
Module
Option Explicit

Public Function Encrypt(ByVal icText As String) As String
 Dim icLen As Integer
 Dim icNewText As String
 icChar = ""
    icLen = Len(icText)
    For i = 1 To icLen
        icChar = Mid(icText, i, 1)
        Select Case Asc(icChar)
            Case 65 To 90
                icChar = Chr(Asc(icChar) + 127)
            Case 97 To 122
                icChar = Chr(Asc(icChar) + 121)
            Case 48 To 57
                icChar = Chr(Asc(icChar) + 196)
            Case 32
                icChar = Chr(32)
        End Select
        icNewText = icNewText + icChar
    Next
    Encrypt = icNewText
End Function

Public Function Decrypt(ByVal icText As String) As String
 Dim icLen As Integer
 Dim icNewText As String
 icChar = ""
    icLen = Len(icText)
    For i = 1 To icLen
        icChar = Mid(icText, i, 1)
        Select Case Asc(icChar)
            Case 192 To 217
                icChar = Chr(Asc(icChar) - 127)
            Case 218 To 243
                icChar = Chr(Asc(icChar) - 121)
            Case 244 To 253
                icChar = Chr(Asc(icChar) - 196)
            Case 32
                icChar = Chr(32)
        End Select
        icNewText = icNewText + icChar
    Next
    Decrypt = icNewText
End Function
:: Navigation

Home

Beginners Corner

Previous Tip

Next Tip

:: Search this site
Google
:: Related Topics
icon 12-02-2004 Re: SQL PASSWORD by JLRodgers
icon 06-11-2003 Re: Help creating a login program by Shady
icon 11-09-2003 Re: Encryption/Decryption of Image files by tmg
icon 05-03-2003 Re: User Login/Password Checking by Shady
icon 15-01-2003 Re: Decrypt a password by vbgen
borderAndreaVB free resources for Visual Basic developersborder
borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2017 Andrea Tincaniborder