ÿþ<html> <head> <title>Decoder</title> <script language="vbscript"> Option Explicit Function UrlDecode(strText) 'As String Dim strBuffer 'As String Dim lngPosition 'As Long For lngPosition = 1 To Len(strText) If Mid(strText, lngPosition, 1) = "%" Then strBuffer = strBuffer & Chr("&H" & Mid(strText, lngPosition + 1, 2)) lngPosition = lngPosition + 2 Else strBuffer = strBuffer & Mid(strText, lngPosition, 1) End If Next UrlDecode = strBuffer End Function Function UrlEncode(strString) 'As String Dim strBuffer Dim lngPos For lngPos = 1 To Len(strString) strBuffer = strBuffer & "%" & Right("0" & Hex(Asc(Mid(strString, lngPos, 1))), 2) Next UrlEncode = strBuffer End Function Function QuotedPrintableDecode(strText) 'As String Dim strBuffer 'As String Dim lngPosition 'As Long For lngPosition = 1 To Len(strText) If Mid(strText, lngPosition, 1) = "=" Then strBuffer = strBuffer & Chr("&H" & Mid(strText, lngPosition + 1, 2)) lngPosition = lngPosition + 2 Else strBuffer = strBuffer & Mid(strText, lngPosition, 1) End If Next QuotedPrintableDecode = strBuffer End Function Function QuotedPrintableEncode(strString) 'As String Dim strBuffer Dim lngPos For lngPos = 1 To Len(strString) strBuffer = strBuffer & "=" & Right("0" & Hex(Asc(Mid(strString, lngPos, 1))), 2) Next QuotedPrintableEncode = strBuffer End Function Function HtmlEncode(strText) 'As String Dim strBuffer Dim lngPos For lngPos = 1 To Len(strText) strBuffer = strBuffer & "&#" & Asc(Mid(strText, lngPos, 1)) & ";" Next HtmlEncode = strBuffer End Function Function HtmlDecode(strHtml) Dim strOut, strIn, strChar Dim lngLength, lngPosition, lngChar, lngWord strIn = strHtml 'Replace decimal and unicode escapes. Allow for typical improper Microsoft codes. lngLength = Len(strIn) For lngPosition = 1 To lngLength If Mid(strIn, lngPosition, 2) = "&#" Then 'Get the complete word to be decoded strChar = Mid(strIn, lngPosition, 6) If InStr(strChar, ";") <> 0 Then strChar = Left(strChar, InStr(strChar, ";")) Else strChar = "&#" & FirstNumber(strChar) End If lngWord = Len(strChar) strChar = FirstNumber(strChar) If strChar <> "" Then 'Convert the number after &# to an ASCII or Unicode character lngChar = CLng(strChar) If lngChar > 255 Then strChar = ChrW(lngChar) Else strChar = Chr(lngChar) End If 'Add the character to the output strOut = strOut & strChar 'Big no-no: Increment the loop counter so we don't process the rest of the word. lngPosition = lngPosition + lngWord - 1 Else strOut = strOut & Mid(strIn, lngPosition, 1) End If Else strOut = strOut & Mid(strIn, lngPosition, 1) End If Next 'Replace the other escapes Do While Instr(strOut, "&quot;") <> 0 : strOut = Replace(strOut, "&quot;", Chr(34)) : Loop Do While Instr(strOut, "&amp;") <> 0 : strOut = Replace(strOut, "&amp;", Chr(38)) : Loop Do While Instr(strOut, "&lt;") <> 0 : strOut = Replace(strOut, "&lt;", Chr(60)) : Loop Do While Instr(strOut, "&gt;") <> 0 : strOut = Replace(strOut, "&gt;", Chr(62)) : Loop Do While Instr(strOut, "&nbsp;") <> 0 : strOut = Replace(strOut, "&nbsp;", " ") : Loop Do While Instr(strOut, "&copy;") <> 0 : strOut = Replace(strOut, "&copy;", Chr(169)) : Loop 'Allow for Microsoft's improper escaping of these 6 characters Do While Instr(strOut, "&quot") <> 0 : strOut = Replace(strOut, "&quot;", Chr(34)) : Loop Do While Instr(strOut, "&amp") <> 0 : strOut = Replace(strOut, "&amp;", Chr(38)) : Loop Do While Instr(strOut, "&lt") <> 0 : strOut = Replace(strOut, "&lt;", Chr(60)) : Loop Do While Instr(strOut, "&gt") <> 0 : strOut = Replace(strOut, "&gt;", Chr(62)) : Loop Do While Instr(strOut, "&nbsp") <> 0 : strOut = Replace(strOut, "&nbsp", " ") : Loop Do While Instr(strOut, "&copy") <> 0 : strOut = Replace(strOut, "&copy", Chr(169)) : Loop 'Now continue unescaping everything else Do While Instr(strOut, "&mdash;") <> 0 : strOut = Replace(strOut, "&mdash;", Chr(151)) : Loop Do While Instr(strOut, "&emdash;") <> 0 : strOut = Replace(strOut, "&emdash;", Chr(151)) : Loop Do While Instr(strOut, "&endash;") <> 0 : strOut = Replace(strOut, "&endash;", Chr(151)) : Loop Do While Instr(strOut, "&deg;") <> 0 : strOut = Replace(strOut, "&deg;", Chr(176)) : Loop Do While Instr(strOut, "&Agrave;") <> 0 : strOut = Replace(strOut, "&Agrave;", Chr(192)) : Loop Do While Instr(strOut, "&Acirc;") <> 0 : strOut = Replace(strOut, "&Acirc;", Chr(194)) : Loop Do While Instr(strOut, "&Auml;") <> 0 : strOut = Replace(strOut, "&Auml;", Chr(196)) : Loop Do While Instr(strOut, "&AElig;") <> 0 : strOut = Replace(strOut, "&AElig;", Chr(198)) : Loop Do While Instr(strOut, "&Egrave;") <> 0 : strOut = Replace(strOut, "&Egrave;", Chr(200)) : Loop Do While Instr(strOut, "&Ecirc;") <> 0 : strOut = Replace(strOut, "&Ecirc;", Chr(202)) : Loop Do While Instr(strOut, "&Igrave;") <> 0 : strOut = Replace(strOut, "&Igrave;", Chr(204)) : Loop Do While Instr(strOut, "&Icirc;") <> 0 : strOut = Replace(strOut, "&Icirc;", Chr(206)) : Loop Do While Instr(strOut, "&Ograve;") <> 0 : strOut = Replace(strOut, "&Ograve;", Chr(210)) : Loop Do While Instr(strOut, "&Ocirc;") <> 0 : strOut = Replace(strOut, "&Ocirc;", Chr(212)) : Loop Do While Instr(strOut, "&Ouml;") <> 0 : strOut = Replace(strOut, "&Ouml;", Chr(214)) : Loop Do While Instr(strOut, "&Oslash;") <> 0 : strOut = Replace(strOut, "&Oslash;", Chr(216)) : Loop Do While Instr(strOut, "&Uacute;") <> 0 : strOut = Replace(strOut, "&Uacute;", Chr(218)) : Loop Do While Instr(strOut, "&Uuml;") <> 0 : strOut = Replace(strOut, "&Uuml;", Chr(220)) : Loop Do While Instr(strOut, "&THORN;") <> 0 : strOut = Replace(strOut, "&THORN;", Chr(222)) : Loop Do While Instr(strOut, "&agrave;") <> 0 : strOut = Replace(strOut, "&agrave;", Chr(224)) : Loop Do While Instr(strOut, "&acirc;") <> 0 : strOut = Replace(strOut, "&acirc;", Chr(226)) : Loop Do While Instr(strOut, "&auml;") <> 0 : strOut = Replace(strOut, "&auml;", Chr(228)) : Loop Do While Instr(strOut, "&aelig;") <> 0 : strOut = Replace(strOut, "&aelig;", Chr(230)) : Loop Do While Instr(strOut, "&egrave;") <> 0 : strOut = Replace(strOut, "&egrave;", Chr(232)) : Loop Do While Instr(strOut, "&ecirc;") <> 0 : strOut = Replace(strOut, "&ecirc;", Chr(234)) : Loop Do While Instr(strOut, "&igrave;") <> 0 : strOut = Replace(strOut, "&igrave;", Chr(236)) : Loop Do While Instr(strOut, "&icirc;") <> 0 : strOut = Replace(strOut, "&icirc;", Chr(238)) : Loop Do While Instr(strOut, "&eth;") <> 0 : strOut = Replace(strOut, "&eth;", Chr(240)) : Loop Do While Instr(strOut, "&ograve;") <> 0 : strOut = Replace(strOut, "&ograve;", Chr(242)) : Loop Do While Instr(strOut, "&ocirc;") <> 0 : strOut = Replace(strOut, "&ocirc;", Chr(244)) : Loop Do While Instr(strOut, "&ouml;") <> 0 : strOut = Replace(strOut, "&ouml;", Chr(246)) : Loop Do While Instr(strOut, "&oslash;") <> 0 : strOut = Replace(strOut, "&oslash;", Chr(248)) : Loop Do While Instr(strOut, "&uacute;") <> 0 : strOut = Replace(strOut, "&uacute;", Chr(250)) : Loop Do While Instr(strOut, "&uuml;") <> 0 : strOut = Replace(strOut, "&uuml;", Chr(252)) : Loop Do While Instr(strOut, "&thorn;") <> 0 : strOut = Replace(strOut, "&thorn;", Chr(254)) : Loop Do While Instr(strOut, "&Aacute;") <> 0 : strOut = Replace(strOut, "&Aacute;", Chr(193)) : Loop Do While Instr(strOut, "&Atilde;") <> 0 : strOut = Replace(strOut, "&Atilde;", Chr(195)) : Loop Do While Instr(strOut, "&Aring;") <> 0 : strOut = Replace(strOut, "&Aring;", Chr(197)) : Loop Do While Instr(strOut, "&Ccedil;") <> 0 : strOut = Replace(strOut, "&Ccedil;", Chr(199)) : Loop Do While Instr(strOut, "&Eacute;") <> 0 : strOut = Replace(strOut, "&Eacute;", Chr(201)) : Loop Do While Instr(strOut, "&Euml;") <> 0 : strOut = Replace(strOut, "&Euml;", Chr(203)) : Loop Do While Instr(strOut, "&Iacute;") <> 0 : strOut = Replace(strOut, "&Iacute;", Chr(205)) : Loop Do While Instr(strOut, "&Iuml;") <> 0 : strOut = Replace(strOut, "&Iuml;", Chr(207)) : Loop Do While Instr(strOut, "&Ntilde;") <> 0 : strOut = Replace(strOut, "&Ntilde;", Chr(209)) : Loop Do While Instr(strOut, "&Oacute;") <> 0 : strOut = Replace(strOut, "&Oacute;", Chr(211)) : Loop Do While Instr(strOut, "&Otilde;") <> 0 : strOut = Replace(strOut, "&Otilde;", Chr(213)) : Loop Do While Instr(strOut, "&Ugrave;") <> 0 : strOut = Replace(strOut, "&Ugrave;", Chr(217)) : Loop Do While Instr(strOut, "&Ucirc;") <> 0 : strOut = Replace(strOut, "&Ucirc;", Chr(219)) : Loop Do While Instr(strOut, "&Yacute;") <> 0 : strOut = Replace(strOut, "&Yacute;", Chr(221)) : Loop Do While Instr(strOut, "&szlig;") <> 0 : strOut = Replace(strOut, "&szlig;", Chr(223)) : Loop Do While Instr(strOut, "&aacute;") <> 0 : strOut = Replace(strOut, "&aacute;", Chr(225)) : Loop Do While Instr(strOut, "&atilde;") <> 0 : strOut = Replace(strOut, "&atilde;", Chr(227)) : Loop Do While Instr(strOut, "&aring;") <> 0 : strOut = Replace(strOut, "&aring;", Chr(229)) : Loop Do While Instr(strOut, "&ccedil;") <> 0 : strOut = Replace(strOut, "&ccedil;", Chr(231)) : Loop Do While Instr(strOut, "&eacute;") <> 0 : strOut = Replace(strOut, "&eacute;", Chr(233)) : Loop Do While Instr(strOut, "&euml;") <> 0 : strOut = Replace(strOut, "&euml;", Chr(235)) : Loop Do While Instr(strOut, "&iacute;") <> 0 : strOut = Replace(strOut, "&iacute;", Chr(237)) : Loop Do While Instr(strOut, "&iuml;") <> 0 : strOut = Replace(strOut, "&iuml;", Chr(239)) : Loop Do While Instr(strOut, "&ntilde;") <> 0 : strOut = Replace(strOut, "&ntilde;", Chr(241)) : Loop Do While Instr(strOut, "&oacute;") <> 0 : strOut = Replace(strOut, "&oacute;", Chr(243)) : Loop Do While Instr(strOut, "&otilde;") <> 0 : strOut = Replace(strOut, "&otilde;", Chr(245)) : Loop Do While Instr(strOut, "&ugrave;") <> 0 : strOut = Replace(strOut, "&ugrave;", Chr(249)) : Loop Do While Instr(strOut, "&ucirc;") <> 0 : strOut = Replace(strOut, "&ucirc;", Chr(251)) : Loop Do While Instr(strOut, "&yacute;") <> 0 : strOut = Replace(strOut, "&yacute;", Chr(253)) : Loop Do While Instr(strOut, "&yuml;") <> 0 : strOut = Replace(strOut, "&yuml;", Chr(255)) : Loop HtmlDecode = strOut End Function Function ROT13(strString) 'As String Const DOUBLE_ALPHABET = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ" Dim strBuffer Dim lngPos Dim intChar For lngPos = 1 To Len(strString) intChar = Instr(DOUBLE_ALPHABET, Mid(strString, lngPos, 1)) If intChar = 0 Then strBuffer = strBuffer & Mid(strString, lngPos, 1) Else strBuffer = strBuffer & Mid(DOUBLE_ALPHABET, intChar + 13, 1) End If Next ROT13 = strBuffer End Function Function ROT16(strText) 'ROT16 works by operating on the lower 5 bits of each byte. 'Five bits allow 32 possibilities, and a ROT16 operation rotates 'the five bits ahead by 16. Performing a second ROT16 will put 'the data back to it's original value. Dim lngLength, lngCount Dim intChar, intLow, intHigh Dim strIn, strOut, strChar strIn = strText lngLength = Len(strIn) For lngCount = 1 To lngLength strChar = Mid(strIn, lngCount, 1) intChar = Asc(strChar) intHigh = intChar And 224 intLow = intChar And 31 intLow = (intLow + 16) Mod 32 strChar = Chr(intHigh + intLow) strOut = strOut & strChar Next ROT16 = strOut End Function Function RotateMessageLeft(strText) RotateMessageLeft = Mid(strText, 2) & Left(strText, 1) End Function Function RotateMessageRight(strText) RotateMessageRight = Right(strText, 1) & Left(strText, Len(strText) - 1) End Function Function elgooG(strText) Dim strIn, strOut Dim lngCount strIn = strText Do Until InStr(strIn, vbCrLf) = 0 strOut = strOut & StrReverse(Left(strIn, InStr(strIn, vbCrLf) - 1)) & vbCrLf strIn = Mid(strIn, InStr(strIn, vbCrLf) + 2) Loop If strIn <> "" Then strOut = strOut & StrReverse(strIn) End If strIn = strOut strOut = "" For lngCount = 1 To Len(strIn) Select Case Mid(strIn, lngCount, 1) Case "/" strOut = strOut & "\" Case "\" strOut = strOut & "/" Case "(" strOut = strOut & ")" Case ")" strOut = strOut & "(" Case "[" strOut = strOut & "]" Case "]" strOut = strOut & "[" Case ">" strOut = strOut & "<" Case "<" strOut = strOut & ">" Case "{" strOut = strOut & "}" Case "}" strOut = strOut & "{" Case Else strOut = strOut & Mid(strIn, lngCount, 1) End Select Next elgooG = strOut End Function Function ShiftLeft(strText) Dim strOut, strChar Dim lngLength, lngCount, lngChar strOut = "" lngLength = Len(strText) For lngCount = 1 To lngLength strChar = Mid(strText, lngCount, 1) lngChar = Asc(strChar) strOut = strOut & Chr((lngChar \ 127) + ((lngChar * 2) Mod 256)) Next ShiftLeft = strOut End Function Function ShiftRight(strText) Dim strOut, strChar Dim lngLength, lngCount, lngChar strOut = "" lngLength = Len(strText) For lngCount = 1 To lngLength strChar = Mid(strText, lngCount, 1) lngChar = Asc(strChar) strOut = strOut & Chr((lngChar \ 2) + ((lngChar And 1) * 128)) Next ShiftRight = strOut End Function Function Xor224(strText) Dim strOut, strChar Dim lngLength, lngCount, lngChar strOut = "" lngLength = Len(strText) For lngCount = 1 To lngLength strChar = Mid(strText, lngCount, 1) lngChar = Asc(strChar) strOut = strOut & Chr(lngChar Xor 224) Next Xor224 = strOut End Function Function Swap2(strText) Dim strOut Dim lngLength, lngCount lngLength = Len(strText) strOut = "" On Error Resume Next 'if odd character count will be error at end For lngCount = 1 To lngLength Step 2 strOut = strOut & Mid(strText, lngCount + 1, 1) strOut = strOut & Mid(strText, lngCount, 1) Next Swap2 = strOut End Function Function Block(strText) 'takes a block of text, arranges it in a grid 'left-to-right / top-to-bottom, then reads it 'top-to-bottom / left-to-right. For example, '0123456789abcdef becomes a 4x4 grid: '0123 '4567 '89ab 'cdef 'which reads out as 048c159d26ae37bf 'To avoid having to pad data, we limit ourselves to square grids 'where the data length is a multiple of the grid size. As long as 'input data length is some multiple of '4,9,16,25,36,49,64,81,100,121,144,169,196,225,or 256, 'we will be able to generate a square grid. Dim lngX, lngTop, lngStep, lngBlock Dim lngLength, lngSquared Dim strOut, strIn, strBlock strOut = "" strIn = strText lngLength = Len(strIn) lngX = 0 'Find the square grid size For lngX = 16 To 1 Step -1 lngSquared = lngX * lngX If lngSquared <= lngLength Then If lngLength Mod lngSquared = 0 Then Exit For End If Next 'Do nothing if the grid size is 1 If lngX = 1 Then Block = strIn Exit Function End If 'Pull out blocks of data For lngBlock = 1 To lngLength Step lngSquared strBlock = Mid(strIn, lngBlock, lngSquared) 'Read the grid For lngTop = 1 To lngX 'The top row pointer For lngStep = 0 To lngX - 1 strOut = strOut & Mid(strBlock, lngTop + lngStep * lngX, 1) Next Next Next Block = strOut End Function Function B64Decode(strText) 'Base 64 decoding takes a stream of input characters, each 'of which represents six bits, and reassembles a new stream 'comprised of eight bit words. The easiest way to decode it 'is to convert blocks of four 6-bit input words into blocks 'of three 8-bit output words. ' |¯¯¯¯||¯¯¯¯||¯¯¯¯||¯¯¯¯| ' 111111000000111111000000 ' |______||______||______| 'Here are the input characters which represent the 6-bit words: Const B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" 'An "A" represents "000000", "B" is "000001", and a "/" represents "111111" 'Because we wil be processing four input words at a time, we must be sure 'our input is a multiple of four characters long. To make the length count 'accurate, we will first remove anything other than the valid 64 characters 'mentioned above. Dim strIn, strOut, strBuffer, strChar Dim lngLength, lngCount Dim intIn1, intIn2, intIn3, intIn4 Dim intOut1, intOut2, intOut3 Dim strOut1, strOut2, strOut3 strIn = strText 'Don't modify the input (I don't like to use ByVal) 'Remove all illegal characters - easier than ignoring them later lngLength = Len(strIn) For lngCount = 1 To lngLength strChar = Mid(strIn, lngCount, 1) If InStr(B64, strChar) <> 0 Then strBuffer = strBuffer & strChar End If Next strIn = strBuffer strBuffer = "" 'Pad to make it a multiple of 4 characters long lngLength = Len(strIn) Do While Len(strIn) Mod 4 <> 0 strIn = strIn & "=" Loop 'Process blocks of four input characters For lngCount = 1 To lngLength Step 4 'Get the four six-bit values intIn1 = InStr(B64, Mid(strIn, lngCount, 1)) - 1 intIn2 = InStr(B64, Mid(strIn, lngCount + 1, 1)) - 1 intIn3 = InStr(B64, Mid(strIn, lngCount + 2, 1)) - 1 intIn4 = InStr(B64, Mid(strIn, lngCount + 3, 1)) - 1 'As we calculate each value, we have to constantly check for the 'input value of -1, which indicates we hit a pad characters at the end. 'The first output is the first input and upper two bits of second input intOut1 = intIn1 * 4 'the entire first input If intIn2 <> -1 Then intOut1 = intOut1 + (intIn2 \ 16) 'the upper two bits of the second input End If strOut1 = Chr(intOut1) 'The second output is the lower 4 bits of the second input and upper 4 bits of the third If intIn2 <> -1 Then intOut2 = (intIn2 And 15) * 16 'lower 4 bits of the second input If intIn3 <> -1 Then intOut2 = intOut2 + (intIn3 \ 4) 'upper 4 bits of the third input End If strOut2 = Chr(intOut2) Else strOut2 = "" End If 'The third output is the lower two bits of the third input and all the fourth If intIn3 <> -1 Then intOut3 = (intIn3 And 3) * 64 If intIn4 <> -1 Then intOut3 = intOut3 + intIn4 'all the fourth End If strOut3 = Chr(intOut3) Else strOut3 = "" End If 'Append the three characters to the output strOut = strOut & strOut1 & strOut2 & strOut3 Next 'Return the output B64Decode = strOut End Function Function B64toMime(strB64Text) Dim strOut Dim intCount 'Pad the end with equal signs strOut = strB64Text Do Until Len(strOut) Mod 4 = 0 strOut = strOut & "=" Loop 'Break into 64 character lines If Len(strOut) > 64 Then For intCount = 64 To Len(strOut) Step 64 strOut = Left(strOut, intCount) & vbCrLf & Mid(strOut, intCount + 1) intCount = intCount + 2 'Big no-no modifying loop variable! Next End If B64toMime = strOut End Function Function B64Encode(strText) 'Base 64 encoding takes an input stream and considers 6 bits 'at a time. One of 64 pre-selected characters is chosen to represent 'that block of six bits. Here is the list of 64 output characters: Const B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" 'The easy way of encoding is to take three 8-bit characters and 'convert them into four 6-bit characters. ' |¯¯¯¯¯¯||¯¯¯¯¯¯||¯¯¯¯¯¯| ' 111111110000000011111111 ' |____||____||____||____| 'Since the easy way needs groups of three input characters at 'a time, we may have to add dummy "pad" characters on the end. 'However, we don't want to actually include the added pad 'characters in the output! Since we will only add two (at most) 'pad characters, only the third and fourth output characters 'are in danger of relying strictly on input pad characters. If 'we determine a pad is being processed, we stop. Dim strIn, strOut Dim lngCount, lngLength Dim intIn1, intIn2, intIn3 Dim intOut1, intOut2, intOut3, intOut4 Dim strOut1, strOut2, strOut3, strOut4 strIn = strText 'Preserve the input. I could have used ByVal... 'Make the input a multiple of 3 characters in length by adding pads. lngLength = Len(strIn) Do Until Len(strIn) Mod 3 = 0 strIn = strIn & Chr(0) Loop For lngCount = 1 To lngLength Step 3 'Get the three input characters byte values intIn1 = Asc(Mid(strIn, lngCount, 1)) intIn2 = Asc(Mid(strIn, lngCount + 1, 1)) intIn3 = Asc(Mid(strIn, lngCount + 2, 1)) 'The first output is the upper six bits of the first input intOut1 = intIn1 \ 4 'divide to throw away the lower two bits strOut1 = Mid(B64, intOut1 + 1, 1) 'The second output is the lower 2 bits of the first input 'and the upper four bits of the second input intOut2 = (intIn1 And 3) * 16 'the lower two bits of the first input intOut2 = intOut2 + (intIn2 \ 16) 'the upper four bits of the second input strOut2 = Mid(B64, intOut2 + 1, 1) 'Are we looking at an end pad byte? If lngCount + 1 > lngLength Then 'Ignore input pad bytes and output nothing strOut3 = "" Else 'The third output is the lower four of the second input 'and the upper two bits of the third input intOut3 = (intIn2 And 15) * 4 'the lower four bits of the second input intOut3 = intOut3 + (intIn3 \ 64) 'the upper two bits of the third input strOut3 = Mid(B64, intOut3 + 1, 1) End If 'Are we looking at an end pad byte? If lngCount + 2 > lngLength Then 'Ignore input pad bytes and output nothing strOut4 = "" Else 'The fourth output is the lower six bits of the third input intOut4 = (intIn3 And 63) strOut4 = Mid(B64, intOut4 + 1, 1) End If 'Append the four characters to the output strOut = strOut & strOut1 & strOut2 & strOut3 & strOut4 Next B64Encode = strOut End Function Function yDecode(strText) 'yDecoding invloves subtracting 42 from the value of every 'byte (Mod 256). A special case is made if the input character 'is the special escape character "=". In that case, the following 'character has an additional 64 subtracted from it (Mod 256). 'Because NULL, CR, and LF are not allowed in a yEnc stream, they 'are ignored if they are encountered. Please refer to www.yenc.org 'for more details Dim strIn, strOut, strChar, strIgnore Dim intOut, lngLength, lngCount Dim blnEscape strOut = "" strIgnore = Chr(0) & Chr(10) & Chr(13) strIn = strText blnEscape = False lngLength = Len(strIn) For lngCount = 1 To lngLength strChar = Mid(strIn, lngCount, 1) intOut = Asc(strChar) If InStr(strIgnore, strChar) = 0 Then If strChar = "=" Then 'the escape character blnEscape = True Else If blnEscape Then intOut = intOut - 64 blnEscape = False End If intOut = intOut - 42 If intOut < 0 Then intOut = intOut + 256 strOut = strOut & Chr(intOut) End If End If Next yDecode = strOut End Function Function yEncode(strText) 'yEncoding is a simple ROT-42 of an eight-bit word. A few output values 'are "escaped" by preceeding them with an equal sign and performing an 'additional ROT-64. Escaped characters must include 0(NULL), 10(LF), '13(CR), 61(=), and may include 32(SPACE), 9(TAB), and 46(.) 'Please refer to www.yenc.org for more information Dim strIn, strOut, strEscapes Dim intOut, lngCount, lngLength strEscapes = Chr(0) & Chr(10) & Chr(13) & Chr(61) & Chr(32) & Chr(9) & Chr(46) strOut = "" strIn = strText lngLength = Len(strIn) For lngCount = 1 To lngLength intOut = Asc(Mid(strIn, lngCount, 1)) intOut = (intOut + 42) Mod 256 If InStr(strEscapes, Chr(intOut)) = 0 Then strOut = strOut & Chr(intOut) Else strOut = strOut & "=" & Chr((intOut + 64) Mod 256) End If Next yEncode = strOut End Function Function YtoNNTP(strYencText, lngFileLength, strFileName) 'This function takes raw yEncoded text and formats it for posting to NNTP Dim strOut, strIn Dim intCount Dim blnNewLine strIn = strYencText 'Break into 64 character lines If Len(strIn) > 64 Then blnNewLine = False For intCount = 1 To Len(strIn) Step 64 If blnNewLine Then strOut = strOut & vbCrLf Else blnNewLine = True End If strOut = strOut & Mid(strIn, intCount, 64) Next Else strOut = strIn End If YtoNNTP = "=ybegin line=" _ & CStr((lngFileLength \ 45) + 3) _ & " size=" & CStr(lngFileLength) _ & " name=" & strFileName & vbCrLf & strOut _ & vbCrLf & "=yend size=" & CStr(lngFileLength) End Function Function NNTPtoY(strNNTPText) 'This function removes all standard yEnc NNTP headers from 'yEncoded text. It should be "mostly harmless" if it is 'run on raw yEncoded text. Dim strOut Dim blnChanged strOut = strNNTPText 'Strip leading blank lines Do While Left(strOut, 2) = vbCrLf strOut = Mid(strOut, 3) Loop 'Remove headers Do blnChanged = False If Left(strOut, 7) = "=ydata " Then strOut = Mid(strOut, InStr(strOut, vbCrLf) + 2) blnChanged = True End If If Left(strOut, 7) = "=ypart " Then strOut = Mid(strOut, InStr(strOut, vbCrLf) + 2) blnChanged = True End If If Left(strOut, 8) = "=ybegin " Then strOut = Mid(strOut, InStr(strOut, vbCrLf) + 2) blnChanged = True End If Loop While blnChanged 'Strip the trailer If InStr(strOut, vbCrLf & "=yend ") <> 0 Then strOut = Left(strOut, InStr(strOut, vbCrLf & "=yend ") - 1) End If NNTPtoY = strOut End Function Function Wrap(strText) Dim strOut, strAdd Dim intCount strOut = "" strAdd = "" 'Break into 64 character lines If Len(strText) > 64 Then For intCount = 1 To Len(strText) Step 64 strAdd = Mid(strText, intCount, 64) If strOut <> "" And strAdd <> "" Then strOut = strOut & vbCrLf strOut = strOut & strAdd Next Else strOut = strText End If Wrap = strOut End Function Function FirstNumber(strNumber) 'As String 'Returns the first number in a string. For example 'CA0567-2 returns 0567 'If there are no numbers, an empty string is returned. Dim strBuffer Dim intCounter Dim blnNumeric strBuffer = "" blnNumeric = False For intCounter = 1 To Len(strNumber) If IsNumeric(Mid(strNumber, intCounter, 1)) Then blnNumeric = True strBuffer = strBuffer & Mid(strNumber, intCounter, 1) Else If blnNumeric Then Exit For End If Next FirstNumber = strBuffer End Function Sub Help(intButton) Dim strHelp CheckText 'This is here to disable inappropriate buttons in case the text is manually edited Select Case intButton Case 1 strHelp = "<b>Shift</b><br><b>Description: </b>The bits in each byte are shifted/rotated " strHelp = strHelp & "by one. Encode shifts left, decode shifts right. " strHelp = strHelp & "If data is encoded eight times, it returns to the original value. " strHelp = strHelp & "This is a non-standard code. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>&#144;&#202;&#216;&#216;&#222;&#64;&#238;&#222;&#228;&#216;&#200;&#66;</tt></b></font>" Case 2 strHelp = "<b>ROT-16</b><br>The lower 5 bits of each byte are incremented by 16, mod 32. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "This is a non-standard code. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>&#88;&#117;&#124;&#124;&#127;&#48;&#103;&#127;&#98;&#124;&#116;&#49;</tt></b></font>" Case 3 strHelp = "<b>XOR-224</b><br>The upper three bits of each byte are toggled. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "This is a non-standard code. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>&#168;&#133;&#140;&#140;&#143;&#192;&#151;&#143;&#146;&#140;&#132;&#193;</tt></b></font>" Case 4 strHelp = "<b>ROT-13</b><br>Letters are rotated 13 positions in the alphabet." strHelp = strHelp & "This has the effect of swapping letters with the letter 13 " strHelp = strHelp & "positions away. For example, A and N are swapped, B and O are " strHelp = strHelp & "swapped, C and P, and so on. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is typically used to encode private messages which " strHelp = strHelp & "use words that might be blocked by mail filtering software. " strHelp = strHelp & "A ROT-13 decoder is built into the Netscape email client. " strHelp = strHelp & "<br>The code is recognizable because it does not alter the case of letters, " strHelp = strHelp & "and does not affect numbers or punctuation. " strHelp = strHelp & "" strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>Uryyb jbeyq!</tt></b></font>" Case 5 strHelp = "<b>B64</b><br>Messages are joined into a continuous bit stream, then broken " strHelp = strHelp & "into 6-bit words. Each word is then represented by one of 64 characters " strHelp = strHelp & "(Upper and lower-case letters, numbers, the forward slash and the plus sign). " strHelp = strHelp & "Message size is increased by one-third. " strHelp = strHelp & "<br>This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is used to encode virtually all attachments and many messages " strHelp = strHelp & "in standard internet email systems to insure transmission through all networks. " strHelp = strHelp & "<br>This code is recognizable because it contains an equal mix of upper and lower-case " strHelp = strHelp & "letters, the expected distribution of numbers, and (often) " strHelp = strHelp & "trailing equal signs as message padding. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>SGVsbG8gd29ybGQh</tt></b></font>" Case 6 strHelp = "<b>yEnc</b><br>Individual bytes are incremented by 42 mod 256. If the encoding should " strHelp = strHelp & "produce a prohibited character (NUL, LF, CR, =), it is incremented by another " strHelp = strHelp & "64 mod 256 and preceeded (escaped) by an equal sign. " strHelp = strHelp & "<br>This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is widely used in internet news groups where large binary files " strHelp = strHelp & "are posted. This code increases message size about two percent. This " strHelp = strHelp & "contrasts with a 33 percent message size increase for competing encoding " strHelp = strHelp & "methods UU and B64. Because this code does not have a MIME registration, it is not " strHelp = strHelp & "widely used in email." strHelp = strHelp & "<br>This code is recognizable because equal signs have a distribution of about two " strHelp = strHelp & "percent and tend to be followed by @, J, M, and }" strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>&#114;&#143;&#150;&#150;&#153;&#74;&#161;&#153;&#156;&#150;&#142;&#75;</tt></b></font>" Case 7 strHelp = "<b>Swap</b><br>This code swaps the position of every other byte in the message. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "This is a non-standard code. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>eHll oowlr!d</tt></b></font>" Case 8 strHelp = "<b>elgooG</b><br>This code reverses each line. It also swaps left and right slashes, parentheses, and brackets. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "<br>This code is used by the elgooG mirrored search engine " strHelp = strHelp & "to allow searching in countries or companies where normally-spelled " strHelp = strHelp & "search terms or search results would be blocked. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>!dlrow olleH</tt></b></font>" Case 9 strHelp = "<b>Block</b><br>This code arranges the message in a square block of equal rows " strHelp = strHelp & "and columns with the usual left-to-right, top-to-bottom layout (just like " strHelp = strHelp & "a book). It then reads the data out a column at a time (like reading " strHelp = strHelp & "the first letter in every line on a page, then reading the second letter " strHelp = strHelp & "of every line, etc.). Rather than add data (padding) the message to fit a " strHelp = strHelp & "particular block size (which can corrupt data that is already encoded), " strHelp = strHelp & "this method will only work if the data can fit or be broken into equal parts " strHelp = strHelp & "that will fit block sizes of 2x2, 3x3, 4x4, etc. through 16x16. " strHelp = strHelp & "<br>This is a symmetrical code (encode and decode do the same thing). " strHelp = strHelp & "This is a non-standard code. " strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>Hlelow ordl!</tt></b></font>" Case 10 strHelp = "<b>Quoted-Printable</b><br>This code replaces any desired byte with an equal sign " strHelp = strHelp & "followed by the two-character hexadecimal value of the byte." strHelp = strHelp & "<br>This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is used in MIME email as a way of encoding text messages " strHelp = strHelp & "that contain relatively few embedded binary characters. " strHelp = strHelp & "<br>This code is recognizable because equal signs are always followed " strHelp = strHelp & "by two hexadecimal characters." strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>=48=65=6C=6C=6F=20=77=6F=72=6C=64=21</tt></b></font>" Case 11 strHelp = "<b>URL-Encoding</b><br>This code replaces any desired byte with a percent sign " strHelp = strHelp & "followed by the two-character hexadecimal value of the byte." strHelp = strHelp & "<br>This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is used in constructing internet URLs where a prohibited character " strHelp = strHelp & "might be needed. Most typically, a space character is replaced with %20." strHelp = strHelp & "<br>This code is recognizable because percent signs are always followed " strHelp = strHelp & "by two hexadecimal characters." strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>%48%65%6C%6C%6F%20%77%6F%72%6C%64%21</tt></b></font>" Case 12 strHelp = "<b>HTML-Escape</b><br>This code replaces any desired byte with an ampersand, a pound symbol, " strHelp = strHelp & "the decimal value of the desired byte, and a semicolon. HTML escaping can also " strHelp = strHelp & "be done for certain punctuation and international text characters by following " strHelp = strHelp & "an ampersand with a special abbreviation and a semicolon. For example, a space " strHelp = strHelp & "character can be represented by either <tt><b>&amp;#32;</b></tt> or <tt><b>&amp;nbsp;</b></tt>. " strHelp = strHelp & "<br>This is a standard code in widespread use. " strHelp = strHelp & "<br>This code is used in web pages and HTML email to insure " strHelp = strHelp & "special abbreviation symbols are transmitted to the client by the network " strHelp = strHelp & "and rendered properly by the browser." strHelp = strHelp & "<br>This code is recognizable because ampersand characters are always followed " strHelp = strHelp & "closely by semicolons." strHelp = strHelp & "<br><font color=""blue""><b><tt>Hello world!</tt></b></font> becomes <font color=""red""><b><tt>&amp;#72;&amp;#101;&amp;#108;&amp;#108;&amp;#111;&amp;#32;&amp;#119;&amp;#111;&amp;#114;&amp;#108;&amp;#100;&amp;#33;</tt></b></font>" Case 13 strHelp = "<b>Decode / Encode</b><br>Select &quot;Decode&quot; if you want to be able to convert encoded text to plain text. " strHelp = strHelp & "Select &quot;Encode&quot; if you want to turn plain text into encoded text." Case 14 strHelp = "<b>Wrap</b><br>If the &quot;Wrap&quot; box is checked, <u>and</u> if the &quot;Encode&quot; Function has also been selected, " strHelp = strHelp & "then the B64 and yEnc encoding functions will produce lines wrapped at the 64th character. " strHelp = strHelp & "This produces neat columns of text and is generally done as a final step. " Case Else strHelp = "" End Select txtExplanation.InnerHtml = strHelp End Sub Sub ButtonPush(intButton) Select Case intButton Case 1 'Shift If frm.rdoDecode(0).checked Then frm.txt.Value = ShiftRight(frm.txt.Value) Else frm.txt.Value = ShiftLeft(frm.txt.Value) End If CheckText Case 2 'ROT16 is symmetrical frm.txt.Value = ROT16(frm.txt.Value) CheckText Case 3 'XOR 224 is symmetrical frm.txt.Value = Xor224(frm.txt.Value) CheckText Case 4 'ROT13 is symmetrical frm.txt.Value = ROT13(frm.txt.Value) Case 5 'B64 If frm.rdoDecode(0).checked Then frm.txt.Value = B64Decode(frm.txt.Value) Else If frm.chkWrap.checked Then frm.txt.Value = Wrap(B64Encode(frm.txt.Value)) Else frm.txt.Value = B64Encode(frm.txt.Value) End If End If CheckText Case 6 'yEncode If frm.rdoDecode(0).checked Then frm.txt.Value = yDecode(NNTPtoY(frm.txt.Value)) Else If frm.chkWrap.checked Then frm.txt.Value = Wrap(yEncode(frm.txt.Value)) Else frm.txt.Value = yEncode(frm.txt.Value) End If End If CheckText Case 7 'Swap2 is symmetrical frm.txt.Value = Swap2(frm.txt.Value) CheckText Case 8 'elgooG is symmetrical frm.txt.Value = elgooG(frm.txt.Value) CheckText Case 9 'Block is symmetrical frm.txt.Value = Block(frm.txt.Value) CheckText Case 10 'Quoted-Printable If frm.rdoDecode(0).checked Then frm.txt.Value = QuotedPrintableDecode(frm.txt.Value) Else frm.txt.Value = QuotedPrintableEncode(frm.txt.Value) End If CheckText Case 11 'URL If frm.rdoDecode(0).checked Then frm.txt.Value = UrlDecode(frm.txt.Value) Else frm.txt.Value = UrlEncode(frm.txt.Value) End If CheckText Case 12 'HTML If frm.rdoDecode(0).checked Then frm.txt.Value = HtmlDecode(frm.txt.Value) Else frm.txt.Value = HtmlEncode(frm.txt.Value) End If CheckText Case Else 'Do nothing End Select End Sub Sub CheckText Dim strText, strError Dim lngLength, lngCount Dim blnBlockOK strText = frm.txt.Value lngLength = Len(strText) strError = "" If frm.rdoDecode(0).checked Then 'Decoding - Enable all buttons frm.btn1.disabled = False frm.btn2.disabled = False frm.btn3.disabled = False frm.btn7.disabled = False frm.btn9.disabled = False Else 'Encoding 'Don't allow binary functions to generate a CR or LF If InStr(strText, ShiftRight(Chr(13))) Or InStr(strText, ShiftRight(Chr(10))) Then frm.btn1.disabled = True strError = strError & "Button 1 would generate CR or LF. " Else frm.btn1.disabled = False End If If InStr(strText, Rot16(Chr(13))) Or InStr(strText, Rot16(Chr(10))) Then frm.btn2.disabled = True strError = strError & "Button 2 would generate CR or LF. " Else frm.btn2.disabled = False End If If InStr(strText, Xor224(Chr(13))) Or InStr(strText, Xor224(Chr(10))) Then frm.btn3.disabled = True strError = strError & "Button 3 would generate CR or LF. " Else frm.btn3.disabled = False End If If InStr(strText, vbCr) Or InStr(strText, vbLf) Then 'Disable all functions that move letters if text has linefeeeds strError = strError & "Button 7 would move existing CR or LF. " strError = strError & "Button 9 would move existing CR or LF. " frm.btn7.disabled = True frm.btn9.disabled = True Else frm.btn7.disabled = False 'Only enable button 9 (block) if data is correct size blnBlockOK = False For lngCount = 2 To 16 If lngLength Mod (lngCount * lngCount) = 0 Then blnBlockOK = True Exit For End If Next frm.btn9.disabled = Not(blnBlockOK) If Not(blnBlockOK) Then strError = strError & "Button 9 disabled because data is wrong length. " End If End If End If txtError.InnerHtml = "<i><font color=""green"">" & strError & "</font></i>" End Sub </script> </head> <body> <script language="javascript"> if(navigator.appName == "Netscape"){ document.write("<font size = +1><b>This web page uses VB Script which requires Internet Explorer.</b></font>"); } </script> <noscript> <font size = +1><b>This web page uses VB Script which requires Internet Explorer with scripting enabled.</b></font> </noscript> <form name="frm"> <table> <tr> <td><i>Nh­p chu×i à mã hóa hay gi£i mã, sau ó chÍn chéc nng thích hãp bên d°Ûi:</i> <br><textarea cols="70" rows="10" wrap="virtual" id="txt"></textarea></td> </tr> <tr> <td> <table cellpadding="10"> <tr><td> <INPUT TYPE=radio id=rdoDecode name=rdoDecode onmouseover="help 13" onmouseout="help 0" onclick="CheckText" CHECKED>&nbsp;Gi£i mã<br> <INPUT TYPE=radio id=rdoDecode name=rdoDecode onmouseover="help 13" onmouseout="help 0" onclick="CheckText">&nbsp;Mã hóa<br> <INPUT type=checkbox id=chkWrap name=chkWrap onmouseover="help 14" onmouseout="help 0" >&nbsp;Ng¯t dòng<br> </td> <td> <div id="txtError" valign="top"></div> </td></tr> <tr> <td valign="top"> <center> <table bgcolor="#000000"> <tr> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 1" onclick="ButtonPush 1" name="btn1"><tt>1<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><font color="blue">(SHF)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 2" onclick="ButtonPush 2" name="btn2"><tt>2<br>&nbsp;abc&nbsp;<br><font color="blue">(R16)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 3" onclick="ButtonPush 3" name="btn3"><tt>3<br>&nbsp;def&nbsp;<br><font color="blue">(XOR)</font></tt></button></center> </td> </tr> <tr> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 4" onclick="ButtonPush 4" name="btn4"><tt>4<br>&nbsp;ghi&nbsp;<br><font color="blue">(ROT)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 5" onclick="ButtonPush 5" name="btn5"><tt>5<br>&nbsp;jkl&nbsp;<br><font color="blue">(B64)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 6" onclick="ButtonPush 6" name="btn6"><tt>6<br>&nbsp;mno&nbsp;<br><font color="blue">(YEN)</font></tt></button></center> </td> </tr> <tr> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 7" onclick="ButtonPush 7" name="btn7"><tt>7<br>pqrs&nbsp;<br><font color="blue">(SWP)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 8" onclick="ButtonPush 8" name="btn8"><tt>8<br>&nbsp;tuv&nbsp;<br><font color="blue">(GGL)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 9" onclick="ButtonPush 9" name="btn9"><tt>9<br>wxyz&nbsp;<br><font color="blue">(BLK)</font></tt></button></center> </td> </tr> <tr> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 10" onclick="ButtonPush 10" name="btnStar"><tt>*<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><font color="blue">(QP)&nbsp;</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 11" onclick="ButtonPush 11" name="btn0"><tt>0<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><font color="blue">(URL)</font></tt></button></center> </td> <td> <center><button language="vbscript" onmouseout="help 0" onmouseover="help 12" onclick="ButtonPush 12" name="btnPound"><tt>#<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><font color="blue">(HTM)</font></tt></button></center> </td> </tr> </table> </td> <td valign="top" height="300"> <div id="txtExplanation"></div> </td> </tr> </table> </form> <br> <b><font size="+2">FAQ:</font></b> <br><b>What is this web page primarily used for?</b> &nbsp;&nbsp; Two things. First, sometimes you get an email which wasn't decoded properly. If you want to clean that email up, you paste it in the above box and press the appropriate decode button. As to which button to press, just hover your mouse over each key and see if the pop-up description matches what your data looks like. The second thing this page is used for is to <u>intentionally</u> mess up some text -- either in a standard way or in a non-standard way. <br><b>Is this data going over the internet?</b> &nbsp;&nbsp; No. All the encoding and decoding takes place entirely on your computer. The actual programming is part of the web page and is run by the VBScript interpreter built in to Internet Explorer. Absolutely no information is sent in or out of your computer. If you want, you can even save this web page on your hard drive, disconnect from the internet, and still use it! The only advantage to using it over the internet is that you always get the most updated version. <br><b>Is this encryption actually secure?</b> &nbsp;&nbsp; No, and more importantly, no! It isn't secure, and it isn't encryption -- it's encoding. The difference is that encoding is just a convenient way of representing something, while encryption is meant to intentionally hide the true content of data. For example, &quot;Base-64&quot; encoding is done to allow messages and attachments to be sent over networks that were only meant for plain text. It isn't meant to encrypt or hide the data, it's merely a conversion to a different format. <br><b>Can this be made to at least <u>act</u> like encryption?</b> &nbsp;&nbsp; Yes. Encryption generally involves changing and re-ordering the data multiple times and in multiple ways. By using several of the available encoding options available here, you can minimally encrypt your data (safe from the average 8 year old or AOL user). Any person who views the resulting &quot;encrypted&quot; data will need to decode your message in the exact reverse order of how you encoded it in order to see the original text. My suggestion is to use B64 (button 5) encoding to scatter the bits between bytes, use the byte-swapping functions (buttons 7, 8, 9) to scatter the bytes within the message, then use an obscuring function (buttons 3, 4, 6) to make the data appear less structured. You may want to do this multiple times and throw in some of the data-padding functions (buttons *, 0, and #) to hide the true length of your message. I recommend using B64 with Word Wrap turned on as the final step to make it easy to copy and paste the end result into any document. <br><b>Why the fake phone keypad?</b> &nbsp;&nbsp; Well... For ordinary de-mangling of improperly decoded email, it's a bother. However, for the <u>second</u> purpose of this web page (intentionally messing up text for casual encryption), it's a help. A phone keypad is probably the most compact way of entering text or numbers. This allows you to easily remember the sequence you used to encode a file so you can later decode it with the reverse sequence. <br><b>Why do buttons keep getting disabled?</b> &nbsp;&nbsp; Due to a side-effect of the Internet Explorer &quot;textarea&quot; used to display the encoded and decoded text, if a carriage-return/linefeed pair (CRLF) is split into separate CR and LF, the textarea will automatically convert both into separate CRLF sequences. This corrupts the data and makes it impossible to recover the intended text! To prevent this from happening, functions which move bytes (buttons 7, 8, 9) and which could split CRLF pairs up are disabled if a CR or LF is present. Functions which might generate CR or LF characters (buttons 1, 2, 3) are disabled if using them would create a CR or LF. Button 9 gets disabled if the data is not the correct length to perform unpadded block encoding. If you pad the data, you will never have to add more than three characters before block encoding is possible. FYI, the B64 decoder used here ignores all unexpected characters, so it is always safe to pad or intersperse B64 data with non-B64-legal characters. <br><b>Can I steal the encoding and decoding functions used here?</b> &nbsp;&nbsp; Sure! I've placed all the code I wrote here in the public domain. That means you can steal the functions, use them elsewhere, and give me no credit at all. Of course, if someone else copyrighted one of the algorithms I used, you'll have to deal with them. </body> </html>