Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

VBScript Rot13 (See related posts)

// description of your code here

Public Function encrypt(strInput As String)
    Dim n As Integer, i As Integer
    n = 13
    For i = 1 To Len(strInput)
        Mid(strInput, i, 1) = Chr(Asc(Mid(strInput, i, 1)) + n)
    Next i
    encrypt = strInput
End Function
 
 
Public Function decrypt(strInput As String)
    Dim n As Integer, i As Integer
    n = 13
    For i = 1 To Len(strInput)
        Mid(strInput, i, 1) = Chr(Asc(Mid(strInput, i, 1)) - n)
    Next i
    decrypt = strInput
End Function

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts