#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=..\..\Desktop\Oxygen-Icons.org-Oxygen-Actions-system-switch-user.ico #AutoIt3Wrapper_Outfile=ENDEC.Exe #AutoIt3Wrapper_Res_Description=One way XOR Encrypt / Decrypt #AutoIt3Wrapper_Res_Fileversion=1.0.0.1 #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #Include #include #include #include #include #include #Region ### START Koda GUI section ### Form= $XOR_GUI = GUICreate("XOR En/Decrypt", 615, 290, 192, 124) $CRYPT_BTN = GUICtrlCreateButton("En/Decrypt", 505, 32, 100, 25) $CLIP_BTN = GUICtrlCreateButton("Copy", 505, 163, 100, 25) $CLEAR_BTN = GUICtrlCreateButton("Clear", 505, 215, 100, 25) $XOR_KEY = GUICtrlCreateInput("61", 535, 100, 50, 15, BitOR($ES_UPPERCASE, $ES_CENTER), 0) $STR_INPUT = GUICtrlCreateEdit("", 24, 32, 469, 105, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL, $ES_UPPERCASE, $ES_MULTILINE), 0) $STR_RESULT = GUICtrlCreateEdit("", 24, 163, 469, 105, BitOR($ES_AUTOVSCROLL, $ES_WANTRETURN, $WS_VSCROLL, $ES_UPPERCASE, $ES_READONLY), 0) GUICtrlSetColor($STR_RESULT, $COLOR_RED) $XOR_KEY_LABEL = GUICtrlCreateLabel("En/Decrypt Key", 517, 80, 100, 17) $STR_INPUT_LABEL = GUICtrlCreateLabel("String [ HEX ] 0", 24, 8, 200, 17) $STR_RESULT_LABEL = GUICtrlCreateLabel("Result [ HEX ] 0", 24, 144, 200, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Global $STR_DATA = [''] While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $CRYPT_BTN Convert() Case $CLIP_BTN ClipPut(GUICtrlRead($STR_RESULT)) Case $CLEAR_BTN Clear() EndSwitch WEnd Func Convert() GUICtrlSetData($STR_INPUT_LABEL, 'String [ HEX ] ' & StringLen(GUICtrlRead($STR_INPUT))) $STR_READ = '0x' & StringStripWS(GUICtrlRead($STR_INPUT), 8) Dim $STR_DATA = [''] For $i = 1 To StringLen($STR_READ) Step 2 If StringLen(GUICtrlRead($STR_INPUT)) > 0 Then $STR_TRIM = '0x' & StringMid($STR_READ, $i, 2) $XOR_STR = BitXOR($STR_TRIM, '0x' & GUICtrlRead($XOR_KEY)) _ArrayAdd($STR_DATA, StringMid(Hex($XOR_STR), 7, 2)) Else ContinueLoop Dim $STR_DATA = [''] EndIf Next If StringLen(GUICtrlRead($STR_INPUT)) > 0 Then $STR_PARSE = _ArrayToString($STR_DATA, ' ', 2, UBound($STR_DATA) -1) GUICtrlSetData($STR_RESULT, $STR_PARSE) GUICtrlSetData($STR_RESULT_LABEL, 'Result [ HEX ] ' & StringLen(GUICtrlRead($STR_RESULT))) Else MsgBox(48, 'ERROR', @error & ' There is no data to parse.') Clear() EndIf EndFunc Func Clear() GUICtrlSetData($STR_INPUT, '') GUICtrlSetData($STR_INPUT_LABEL, 'String [ HEX ] 0') GUICtrlSetData($STR_RESULT, '') GUICtrlSetData($STR_RESULT_LABEL, 'Result [ HEX ] 0') Dim $STR_DATA = [''] EndFunc