Here's a version I did a while ago. It scrambles a little differently because it starts with the last character, then the first, and so on. ;; For Testing
;$sOrig = "Apple"
$sOrig = "AutoIt3 is the best!"
$sScrambled = _Scramble($sOrig)
$sDeScrambled = _DeScramble($sScrambled)
MsgBox(4096, "test", "$sOrig = " & $sOrig &@LF& "$sScrambled = " & $sScrambled &@LF& "$sDeScrambled = " & $sDeScrambled)
Exit
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func _Scramble($sText)
;; Scramble a text string.
$iLen = StringLen($sText)
$Scrambled = ""
For $i1 = 1 To Int($iLen / 2)
$Scrambled = $Scrambled & StringMid($sText, $iLen - $i1 + 1, 1) & StringMid($sText, $i1, 1)
Next; $i1
; Pick up the odd character.
If Mod($iLen, 2) Then
$Scrambled = $Scrambled & StringMid($sText, $i1, 1)
EndIf
Return $Scrambled
EndFunc ;==>_Scramble
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func _DeScramble($sText)
;; De-Scramble a Scrambled text that was scrambled by _Scramble.
Local $iLen = StringLen($sText)
Local $i, $DeScrambled1, $DeScrambled2
$DeScrambled1 = ""
$DeScrambled2 = ""
For $i1 = 1 To $iLen step 2
$DeScrambled1 = StringMid($sText, $i1, 1) & $DeScrambled1
$DeScrambled2 = $DeScrambled2 & StringMid($sText, $i1 + 1, 1)
Next; $i1
; Pick up the odd character.
If Mod($iLen, 2) Then
$DeScrambled1 = StringMid($sText, $i1, 1) & $DeScrambled1
EndIf
$sText = $DeScrambled2 & $DeScrambled1
Return $DeScrambled2 & $DeScrambled1
EndFunc ;==>_DeScramble