#Region Includes #include #include #EndRegion Includes ; ============================================================================= ; Name ..........: Web-Txt-Scrambler ; Description ...: Makes your text in websites only readable for the user. ; Requirement ...: de-DE.dic (dictionary file of the de_DE Hunspell dictionary) ; AutoIt Version : V3.3.0.0 ; Syntax ........: Text to scramble (commandline!) ; Parameter(s): .: $Texttoscramble - ; Return Value ..: Success - Scrambled text ; Failure - "" ; Author(s) .....: Thorsten Willert ; Date ..........: Thu Oct 29 10:35:02 CET 2009 ; Version .......: 2.0 ; ============================================================================== ;MsgBox(64,"",$CmdLine[1]) Global $mail = $CmdLine[1] Global $bJavaScript = False ; adding unicode excapes for JavaScript output Global $bEscape = False; works only with unescape in JavaScript or in URLs ; don't use this for URLs Global $bComments = True; Comments Global $bStyle = True; Comments and hidden CSS styles Global $sWoerterbuch = @ScriptDir & "\de-DE.dic" Global $iStart = 0 Global $iEnd = 6 If Not $bJavaScript Then $iStart = 1 If Not $bEscape Then $iStart = 2 If Not $bComments Then $iEnd = 4 If Not $bStyle Then $iEnd = 5 Global $aMail = StringSplit($mail, "", 0) Global $rnd_alt = 10 Global $rnd = 10 Global $Start = 1 Global $sRnd = "" Global $sID = "" Global $sDummySpan = "" Global $aWoerter If FileExists($sWoerterbuch) Then _FileReadToArray($sWoerterbuch, $aWoerter) $sID = _RandomString(1) $sDummySpan = _RandomString(1) Global $ret = '" & @CRLF & @CRLF & @CRLF For $i = 1 To $aMail[0] $sRnd = "" If $aMail[$i] = " " Then $ret &= " " ContinueLoop EndIf If $aMail[$i] = "@" Then $ret &= "@" ContinueLoop EndIf While $rnd_alt = $rnd $rnd = Random($iStart, $iEnd, 1) WEnd Switch $rnd Case 0 $ret &= StringFormat("\\u%0000s", Hex(AscW($aMail[$i]), 4)) Case 1 $ret &= "%" & Hex(AscW($aMail[$i]), 2) Case 2 $tmp = StringFormat("&#x%02s;", StringReplace(Hex(AscW($aMail[$i]), 2), "0", "F")) Switch Random(1, 2, 1) Case 1 $ret &= $tmp Case 2 $ret &= '' & $tmp & '' EndSwitch Case 3 $tmp = StringFormat("&#x%04s;", Hex(AscW($aMail[$i]), 4)) Switch Random(1, 2, 1) Case 1 $ret &= $tmp Case 2 $ret &= '' & $tmp & '' EndSwitch Case 4 $tmp = "&#" & Asc($aMail[$i]) & ";" Switch Random(1, 2, 1) Case 1 $ret &= $tmp Case 2 $ret &= '' & $tmp & '' EndSwitch Case 5 $ret &= StringFormat("", _JustRandom(2)) & $aMail[$i] Case 6 $ret &= '' & _JustRandom() & '' & $aMail[$i] EndSwitch $rnd_alt = $rnd Next ;ClipPut($ret) ConsoleWrite($ret & @CRLF) ;=============================================================================== Func _RandomString($iMode, $iMin = 10, $iMax = 25) Local $t, $sReturn = "" Switch $iMode Case 1 ; 90-97 For $j = 0 To Random($iMin, $iMax) Do $t = Random(65, 122) Until $t > 97 Or $t < 90 $sReturn &= Chr($t) Next Case 2 For $j = 0 To Random($iMin, $iMax) Do $t = Random(39, 126) Until ($t > 97 Or $t < 90) And ($t < 59 Or $t > 63) $sReturn &= Chr($t) Next EndSwitch Return $sReturn EndFunc ;==>_RandomString ;=============================================================================== Func _RandomWord() If $aWoerter[0] > 500 Then Local $sWord = $aWoerter[Random(20, $aWoerter[0], 1)] Return StringMid($sWord, 1, StringInStr($sWord, "/") - 1) Else Return _RandomString(1) EndIf EndFunc ;==>_RandomWord ;=============================================================================== Func _RandomEncode($s) Switch Random(0, 3, 1) Case 0 Return StringFormat("&#x%02s;", StringReplace(Hex(AscW($s), 2), "0", "F")) Case 1 Return StringFormat("&#x%04s;", Hex(AscW($s), 4)) Case 2 Return "&#" & Asc($s) & ";" Case 3 Return $s EndSwitch EndFunc ;==>_RandomEncode ;=============================================================================== Func _RandomWordEncode($sWord) Local $sReturn = "" Local $aString = StringSplit($sWord, "") For $i = 1 To $aString[0] $sReturn &= _RandomEncode($aString[$i]) Next Return $sReturn EndFunc ;==>_RandomWordEncode ;=============================================================================== Func _JustRandom($iMode = 4) Switch Random(1, $iMode, 1) Case 1 Return _RandomWord() Case 2 Return _RandomString(2, 0) Case 3 Return _RandomWordEncode(_RandomWord()) Case 4 Return _RandomWordEncode(_RandomString(2)) EndSwitch EndFunc ;==>_JustRandom