a clean Text Encryption/Decryption module

By | 2002-06-01

This code will take your text and encrypt it so that it is completely non-readable. I am sure that is someone studied the output long enouch they might be able to break the code, but it would be tough. You can see how easy it actually is to encrypt/decrypt text. It cover all basic letters and most special characters. If you can see it on your keyboard then that character has been covered. Later versions of this code will be much more complex in the way it encrypts the text. and I may include a feature that will require a key to unlock the text. Have fun. Peace

Original Author: gHost_44

Inputs

Just some Text. that is it.

Assumptions

Just paste this code into a module and you should be all set.

Returns

It may look as if someone fell asleep on there keyboard but it is fact encrypted text.

Side Effects

none that I know of.

API Declarations

Option Explicit

Code

Public Function Encode(vText As String)
Dim CurSpc As Integer
Dim varLen As Integer
Dim varChr As String
Dim varFin As String

varLen = Len(vText)
Do While CurSpc <= varLen
DoEvents
  CurSpc = CurSpc + 1
  varChr = Mid(vText, CurSpc, 1)
  Select Case varChr
   'lower case
   Case "a"
    varChr = "coe"
   Case "b"
    varChr = "wer"
   Case "c"
    varChr = "ibq"
   Case "d"
    varChr = "am7"
   Case "e"
    varChr = "pm1"
   Case "f"
    varChr = "mop"
   Case "g"
    varChr = "9v4"
   Case "h"
    varChr = "qu6"
   Case "i"
    varChr = "zxc"
   Case "j"
    varChr = "4mp"
   Case "k"
    varChr = "f88"
   Case "l"
    varChr = "qe2"
   Case "m"
    varChr = "vbn"
   Case "n"
    varChr = "qwt"
   Case "o"
    varChr = "pl5"
   Case "p"
    varChr = "13s"
   Case "q"
    varChr = "c%l"
   Case "r"
    varChr = "w$w"
   Case "s"
    varChr = "6a@"
   Case "t"
    varChr = "!2&"
   Case "u"
    varChr = "(=c"
   Case "v"
    varChr = "wvf"
   Case "w"
    varChr = "dp0"
   Case "x"
    varChr = "w$-"
   Case "y"
    varChr = "vn&"
   Case "z"
    varChr = "c*4"
  
   'numbers
   Case "1"
    varChr = "aq@"
   Case "2"
    varChr = "902"
   Case "3"
    varChr = "2.&"
   Case "4"
    varChr = "/w!"
   Case "5"
    varChr = "|pq"
   Case "6"
    varChr = "ml|"
   Case "7"
    varChr = "t'?"
   Case "8"
    varChr = ">^s"
   Case "9"
    varChr = "   Case "0"
    varChr = ";&c"
  
   'caps
   Case "A"
    varChr = "$)c"
   Case "B"
    varChr = "-gt"
   Case "C"
    varChr = "|p*"
   Case "D"
    varChr = "1" & Chr(34) & "r"
   Case "E"
    varChr = "c>:"
   Case "F"
    varChr = "@+x"
   Case "G"
    varChr = "v^a"
   Case "H"
    varChr = "]eE"
   Case "I"
    varChr = "aP0"
   Case "J"
    varChr = "{=1"
   Case "K"
    varChr = "cWv"
   Case "L"
    varChr = "cDc"
   Case "M"
    varChr = "*,!"
   Case "N"
    varChr = "fW" & Chr(34)
   Case "O"
    varChr = ".?T"
   Case "P"
    varChr = "%<8"
   Case "Q"
    varChr = "@:a"
   Case "R"
    varChr = "&c$"
   Case "S"
    varChr = "WnY"
   Case "T"
    varChr = "{Sh"
   Case "U"
    varChr = "_%M"
   Case "V"
    varChr = "}'$"
   Case "W"
    varChr = "QlU"
   Case "X"
    varChr = "Im^"
   Case "Y"
    varChr = "l|P"
   Case "Z"
    varChr = ".>#"
   'Special characters
   Case "!"
    varChr = "" & Chr(34) & "]"
   Case "@"
    varChr = "cY,"
   Case "#"
    varChr = "x%B"
   Case "$"
    varChr = "a*v"
   Case "%"
    varChr = "'&T"
   Case "^"
    varChr = ";%R"
   Case "&"
    varChr = "eG_"
   Case "*"
    varChr = "Z/e"
   Case "("
    varChr = "rG"
   Case ")"
    varChr = "]*F"
   Case "_"
    varChr = "@B*"
   Case "-"
    varChr = "+Hc"
   Case "="
    varChr = "&|D"
   Case "+"
    varChr = "(:#"
   Case "["
    varChr = "SlW"
   Case "]"
    varChr = "'QB"
   Case "{"
    varChr = "{D>"
   Case "}"
    varChr = "+c%"
   Case ":"
    varChr = "(s:"
   Case ";"
    varChr = "^a("
   Case "'"
    varChr = "16."
   Case Chr(34)
    varChr = "s.*"
   Case ","
    varChr = "&?W"
   Case "."
    varChr = "GPQ"
   Case "<"
    varChr = "SK*"
   Case ">"
    varChr = "RL^"
   Case "/"
    varChr = "40C"
   Case "?"
    varChr = "?#9"
   Case ""
    varChr = "_?/"
   Case "|"
    varChr = "(_@"
   Case " "
    varChr = "=#B"
  End Select
  
  varFin = varFin & varChr
DoEvents
Loop

Encode = varFin
End Function
Public Function DeCode(vText As String)
Dim CurSpc As Integer
Dim varLen As Integer
Dim varChr As String
Dim varFin As String
CurSpc = CurSpc + 1
varLen = Len(vText)
Do While CurSpc <= varLen
DoEvents
  
  varChr = Mid(vText, CurSpc, 3)
  
  
  
  Select Case varChr
   'lower case
   Case "coe"
    varChr = "a"
   Case "wer"
    varChr = "b"
   Case "ibq"
    varChr = "c"
   Case "am7"
    varChr = "d"
   Case "pm1"
    varChr = "e"
   Case "mop"
    varChr = "f"
   Case "9v4"
    varChr = "g"
   Case "qu6"
    varChr = "h"
   Case "zxc"
    varChr = "i"
   Case "4mp"
    varChr = "j"
   Case "f88"
    varChr = "k"
   Case "qe2"
    varChr = "l"
   Case "vbn"
    varChr = "m"
   Case "qwt"
    varChr = "n"
   Case "pl5"
    varChr = "o"
   Case "13s"
    varChr = "p"
   Case "c%l"
    varChr = "q"
   Case "w$w"
    varChr = "r"
   Case "6a@"
    varChr = "s"
   Case "!2&"
    varChr = "t"
   Case "(=c"
    varChr = "u"
   Case "wvf"
    varChr = "v"
   Case "dp0"
    varChr = "w"
   Case "w$-"
    varChr = "x"
   Case "vn&"
    varChr = "y"
   Case "c*4"
    varChr = "z"
  
   'numbers
   Case "aq@"
    varChr = "1"
   Case "902"
    varChr = "2"
   Case "2.&"
    varChr = "3"
   Case "/w!"
    varChr = "4"
   Case "|pq"
    varChr = "5"
   Case "ml|"
    varChr = "6"
   Case "t'?"
    varChr = "7"
   Case ">^s"
    varChr = "8"
   Case "    varChr = "9"
   Case ";&c"
    varChr = "0"
  
   'caps
   Case "$)c"
    varChr = "A"
   Case "-gt"
    varChr = "B"
   Case "|p*"
    varChr = "C"
   Case "1" & Chr(34) & "r"
    varChr = "D"
   Case "c>:"
    varChr = "E"
   Case "@+x"
    varChr = "F"
   Case "v^a"
    varChr = "G"
   Case "]eE"
    varChr = "H"
   Case "aP0"
    varChr = "I"
   Case "{=1"
    varChr = "J"
   Case "cWv"
    varChr = "K"
   Case "cDc"
    varChr = "L"
   Case "*,!"
    varChr = "M"
   Case "fW" & Chr(34)
    varChr = "N"
   Case ".?T"
    varChr = "O"
   Case "%<8"
    varChr = "P"
   Case "@:a"
    varChr = "Q"
   Case "&c$"
    varChr = "R"
   Case "WnY"
    varChr = "S"
   Case "{Sh"
    varChr = "T"
   Case "_%M"
    varChr = "U"
   Case "}'$"
    varChr = "V"
   Case "QlU"
    varChr = "W"
   Case "Im^"
    varChr = "X"
   Case "l|P"
    varChr = "Y"
   Case ".>#"
    varChr = "Z"
   'Special characters
   Case "" & Chr(34) & "]"
    varChr = "!"
   Case "cY,"
    varChr = "@"
   Case "x%B"
    varChr = "#"
   Case "a*v"
    varChr = "$"
   Case "'&T"
    varChr = "%"
   Case ";%R"
    varChr = "^"
   Case "eG_"
    varChr = "&"
   Case "Z/e"
    varChr = "*"
   Case "rG"
    varChr = "("
   Case "]*F"
    varChr = ")"
   Case "@B*"
    varChr = "_"
   Case "+Hc"
    varChr = "-"
   Case "&|D"
    varChr = "="
   Case "(:#"
    varChr = "+"
   Case "SlW"
    varChr = "["
   Case "'QB"
    varChr = "]"
   Case "{D>"
    varChr = "{"
   Case "+c%"
    varChr = "}"
   Case "(s:"
    varChr = ":"
   Case "^a("
    varChr = ";"
   Case "16."
    varChr = "'"
   Case "s.*"
    varChr = Chr(34)
   Case "&?W"
    varChr = ","
   Case "GPQ"
    varChr = "."
   Case "SK*"
    varChr = "<"
   Case "RL^"
    varChr = ">"
   Case "40C"
    varChr = "/"
   Case "?#9"
    varChr = "?"
   Case "_?/"
    varChr = ""
   Case "(_@"
    varChr = "|"
   Case "=#B"
    varChr = " "
  End Select
  varFin = varFin & varChr
  CurSpc = CurSpc + 3
DoEvents
Loop
DeCode = varFin
End Function

Author: dwirch

Derek Wirch is a seasoned IT professional with an impressive career dating back to 1986. He brings a wealth of knowledge and hands-on experience that is invaluable to those embarking on their journey in the tech industry.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.