Jump to content

Search the Community

Showing results for tags 'scramble text'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hi This is a txt scrambler I wrote long ago, but it just resurfaced when going thru some old code, so I thought that I would share it with you. ; #INDEX# ======================================================================================================================= ; Title .........: Simple Txt (un)Scrambler ; Script Version : 1.0.0 ; AutoIt Version : 3.3.14.0 - Created with ISN AutoIt Studio v. 1.04 ; Description ...: Takes a string and scrambles it, using StringToAsciiArray, Random Multiply, Random letters and BitXOR ; : The return string contains it's own "unscramble" keys, wich is used by the Unscramble funktion to reverse ; : the scrambled string to the orginale string. ; Author(s) .....: Rex ; =============================================================================================================================== ; #CHANGE LOG# ================================================================================================================== ; Changes .......: ; Date ..........: ; =============================================================================================================================== #include <Array.au3> #include <String.au3> #include <StringConstants.au3> ; Excaple Local $sString = 'Hello World' ; Scramble string Local $sScrambled = _ScrampleString($sString) ConsoleWrite(@CRLF & 'Scrambled Msg = ' & $sScrambled & @CRLF) ; Unscramble string ConsoleWrite(@CRLF & 'Unscrambled string = ' & _UnScrampleString($sScrambled) & @CRLF) ; Scramble function Func _ScrampleString($sMsg) ; Converts the string to an Ascii array Local $aMsg = StringToASCIIArray($sMsg) ; reverses the Array _ArrayReverse($aMsg) ; Scramble the string Local $sSMsg, $iMultiplyWithFirst = Random(10, 99, 1), $iMultiplyWithLast = Random(100, 999, 1) ; Scramble the string by multiply some of the Ascii numbers with x and again others with y ; Looping thru the ascii array For $i = 0 To UBound($aMsg) -1 ; Multiplying some of the numbers If IsInt($i/3) then ; If $i dived by 3 is an int. The divede by could be any number $aMsg[$i] = $aMsg[$i] * $iMultiplyWithFirst ElseIf IsInt($i /6) Then ; If $i diveded by 6 is int. The divede by could be any number $aMsg[$i] = $aMsg[$i] * $iMultiplyWithLast EndIf ; Creating the output string ; We do a bitXOR, and add Random letters to the sting $sSMsg &= BitXOR($aMsg[$i],2) & __RandomChar() Next ; Combine and return scrambled string Return $iMultiplyWithFirst & $sSMsg & $iMultiplyWithLast EndFunc ; Internal use for Scramble funktion Func __RandomChar() ; Generates a series of random chars (A-Z) in the range of 1 to 3 in a group Local $sRandChar For $i = 0 To Random(1, 3,1) $sRandChar &= chr(Random(65, 90, 1)) Next Return $sRandChar EndFunc Func _UnScrampleString($sSMsg) ; Get the Multiplyer Local $iDivideWithFirst = StringLeft($sSMsg, 2) Local $iDivideWithLast = StringRight($sSMsg, 3) ;Removing the multiplyer $sSMsg = StringTrimLeft($sSMsg, 2) $sSMsg = StringTrimRight($sSMsg, 3) ; Replaces all Chars from the string with whitespaces Local $sNoChars = StringRegExpReplace($sSMsg, '\D', ' ') ; Removing 2+ whitspaces, stripping the last char from the string and splits the string into an array (Using the no count flag) Local $aSmsg = StringSplit(StringTrimRight(StringStripWS($sNoChars, $STR_STRIPSPACES), 1), ' ', $STR_NOCOUNT) ; Cleaning up the array For $i = 0 To UBound($aSmsg) -1 ; Reversing the BitXOR $aSmsg[$i] = BitXOR($aSmsg[$i],2) ; Recalculating the orginal numbers If IsInt($i/3) then $aSmsg[$i] = $aSmsg[$i] / $iDivideWithFirst ElseIf IsInt($i /6) Then $aSmsg[$i] = $aSmsg[$i] / $iDivideWithLast EndIf Next ; Now all we need is to change the numbers to chars, so we get the original string Local $sOrgMsg For $i = 0 To UBound($aSmsg) -1 $sOrgMsg &= Chr($aSmsg[$i]) Next Return StringReverse($sOrgMsg) EndFunc Cheers /Rex
×
×
  • Create New...