meows

Encrypted Decrypted will not work on cross platforms x32 to x64 errors out x64 to x32 errors out

6 posts in this topic

69
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\TC128.ico
#AutoIt3Wrapper_Outfile=Flyboy_Personal_Encryption_tool.exe
#AutoIt3Wrapper_Outfile_x64=Flyboy_Personal_Encryption_toolx64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Comment=All purpose text crypt tool
#AutoIt3Wrapper_Res_Description=Flyboy_Personal_Encryption_tool
#AutoIt3Wrapper_Res_Fileversion=2.2.2.
#AutoIt3Wrapper_Res_LegalCopyright=Reardon Studio
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <String.au3>
#include <MsgBoxConstants.au3>
_Main()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Flyboy_Personal_Encryption_tool
Func _Main()
    Local $WinMain, $CopyButton, $EditText, $InputPass, $InputLevel, $EncryptButton, $DecryptButton, $string
    ; GUI and String stuff
    $WinMain = GUICreate('Jim Smiths (Flyboy) Personal Encryption tool', 800, 400)
    GUISetBkColor(0xA6CAF0)
    GUICtrlSetDefBkColor( 0x00ced1)  ; Creates window
    $EditText = GUICtrlCreateEdit('', 5, 5, 760, 350)   ; Creates main edit
    $InputPass = GUICtrlCreateInput('', 5, 360, 160, 20, 0x21)  ; Creates the password box with blured/centered input
    $InputLevel = GUICtrlCreateInput(1, 180, 360, 50, 20, 0x2001)
    GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)    ; These two make the level input with the Up|Down ability



    $EncryptButton = GUICtrlCreateButton('Encrypt', 350, 360, 105, 35)  ; Encryption button
    GUICtrlSetBkColor($EncryptButton, 0xff4500)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $DecryptButton = GUICtrlCreateButton('Decrypt', 460, 360, 105, 35)  ; Decryption button
     GUICtrlSetBkColor($DecryptButton, 0xe0ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $CopyButton = GUICtrlCreateButton('CopyButton', 570, 360, 105, 35)  ; CopyButton
    GUICtrlSetBkColor($CopyButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$HelpButton = GUICtrlCreateButton('HelpButton', 690, 360, 105, 35)  ; HelpButton
    GUICtrlSetBkColor($HelpButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel('Password', 15, 385)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)   ;;GUISetBkColor(-1,0xA6CAF0
    GUICtrlCreateLabel('Level of encryption 1=low 10=high', 110, 382, 265, 35)  ; Simple text labels so you know what is what
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState()

; Shows window

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $EncryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(1, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain)   ; This turns the window back on
                ;GUISetState(@SW_SHOW, $CopyButton) ; This turns the CopyButton back on
            Case $DecryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(0, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on  popup
            Case $CopyButton
    GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
    GUICtrlSetState($EditText, $GUI_FOCUS)
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                    ClipPut($string)  ; Add new data to the clipboard.
                ;Run("about.exe")  ; Help about.
            Case $HelpButton
                MsgBox(262208, "Help Information", _
    "Type your message in any application, Outlook, Thunderbird, Office, or" & @LF & _
    "even in the Encryption program, although I did not add Spell Check," & @LF & @LF & _
    "When message is ready paste it into the Encryption window, " & @LF & @LF & _
    "Type in a password and a Encryption level if sending a message to" & @LF & _
    "NASA I recommend Encryption level 10 but for normal use and your" & @LF & _
    "positive NSA is not watching you. Use level One," & @LF & @LF & _
    "Now click the Encrypt Button, When the message looks like Egyptian Hieroglyphics it is complete, " & @LF & @LF & _
    "Click the Copy Button and past into your mail program and click send.;" & @LF & @LF & _
    "When you receive a Encrypted message. I suggest you use EDIT SELECT ALL and EDIT COPY to Select the Encrypted message  " & @LF & @LF & _
    "and then paste it into the Encryption window. The reason is the Encrypted message is one LONG line of code " & @LF & _
    " and will reach 50,000 characters before making a new line. Type in the password and Encryption level" & @LF & _
    "Now you may click the Decryption button and read your safe and secure from all prying eyes personal message," & @LF & @LF & _
    "NOTE:: If your computer is used by others, you can secure all manner of messages, notes, letters, memo's " & @LF & _
    "and the like with this program." & @LF & @LF & _
    "LAST A HINT.. CALL or send a post or a email, to the person(s) whom you share this program " & @LF & _
    "and decide on a password and Encryption level you will use, and use the same settings for all messages," & @LF & _
    " " & @LF & _
    "If You Forget Either The Password Or Encryption Level That Message Is Lost Forever!" & @LF & _
    "Christine", 0)




        EndSwitch
    WEnd ; Continue loop untill window is closed
    Exit
EndFunc   ;==>_Main

I patched together a simple message encryption for a friend. all works perfect if both computers, the sender and receiver use the same operating system. but if you send a message from a win7/32 bit and the receiver is using win7/64bit the message is scrambled and unreadable.

I have no clue as to why this is happening, and would love to understand it and fix it,

Also. if used on a XP32 bit, the compiled 32bit errors out with this

  Server not found

Firefox can't find the server at flyboy_personal_encryption_tool.

  * Check the address for typing errors such as *ww*.example.com instead
    of *www*.example.com
  * If you are unable to load any pages, check your computer's network
    connection.
  * If your computer or network is protected by a firewall or proxy,
    make sure that Firefox is permitted to access the Web.

Try Again
Report this errorâ–¼ <#>

Reporting the address and certificate information for will help us
identify and block malicious sites. Thanks for helping create a safer web!

Automatically report errors in the future

Learn more… <https://support.mozilla.org/kb/certificate-pinning-reports>
Report Try again Sending report Report sent

Yet the 64bit compiled version runs but when sending a message to win7/32 the message is unreadable.

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\TC128.ico
#AutoIt3Wrapper_Outfile=Flyboy_Personal_Encryption_tool.exe
#AutoIt3Wrapper_Outfile_x64=Flyboy_Personal_Encryption_toolx64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Comment=All purpose text crypt tool
#AutoIt3Wrapper_Res_Description=Flyboy_Personal_Encryption_tool
#AutoIt3Wrapper_Res_Fileversion=2.2.2.
#AutoIt3Wrapper_Res_LegalCopyright=Reardon Studio
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <String.au3>
#include <MsgBoxConstants.au3>
_Main()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Flyboy_Personal_Encryption_tool
Func _Main()
    Local $WinMain, $CopyButton, $EditText, $InputPass, $InputLevel, $EncryptButton, $DecryptButton, $string
    ; GUI and String stuff
    $WinMain = GUICreate('Jim Smiths (Flyboy) Personal Encryption tool', 800, 400)
    GUISetBkColor(0xA6CAF0)
    GUICtrlSetDefBkColor( 0x00ced1)  ; Creates window
    $EditText = GUICtrlCreateEdit('', 5, 5, 760, 350)    ; Creates main edit
    $InputPass = GUICtrlCreateInput('', 5, 360, 160, 20, 0x21)  ; Creates the password box with blured/centered input
    $InputLevel = GUICtrlCreateInput(1, 180, 360, 50, 20, 0x2001)
    GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)     ; These two make the level input with the Up|Down ability



    $EncryptButton = GUICtrlCreateButton('Encrypt', 350, 360, 105, 35)    ; Encryption button
    GUICtrlSetBkColor($EncryptButton, 0xff4500)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $DecryptButton = GUICtrlCreateButton('Decrypt', 460, 360, 105, 35)    ; Decryption button
     GUICtrlSetBkColor($DecryptButton, 0xe0ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $CopyButton = GUICtrlCreateButton('CopyButton', 570, 360, 105, 35)    ; CopyButton
    GUICtrlSetBkColor($CopyButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$HelpButton = GUICtrlCreateButton('HelpButton', 690, 360, 105, 35)    ; HelpButton
    GUICtrlSetBkColor($HelpButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel('Password', 15, 385)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)   ;;GUISetBkColor(-1,0xA6CAF0
    GUICtrlCreateLabel('Level of encryption 1=low 10=high', 110, 382, 265, 35)    ; Simple text labels so you know what is what
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState()

; Shows window

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $EncryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(1, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain)   ; This turns the window back on
                ;GUISetState(@SW_SHOW, $CopyButton) ; This turns the CopyButton back on
            Case $DecryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _StringEncrypt(0, $string, GUICtrlRead($InputPass), GUICtrlRead($InputLevel)))
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on  popup
            Case $CopyButton
    GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
    GUICtrlSetState($EditText, $GUI_FOCUS)
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                     ClipPut($string)  ; Add new data to the clipboard.
                ;Run("about.exe")  ; Help about.
            Case $HelpButton
                MsgBox(262208, "Help Information", _
    "Type your message in any application, Outlook, Thunderbird, Office, or" & @LF & _
    "even in the Encryption program, although I did not add Spell Check," & @LF & @LF & _
    "When message is ready paste it into the Encryption window, " & @LF & @LF & _
    "Type in a password and a Encryption level if sending a message to" & @LF & _
    "NASA I recommend Encryption level 10 but for normal use and your" & @LF & _
    "positive NSA is not watching you. Use level One," & @LF & @LF & _
    "Now click the Encrypt Button, When the message looks like Egyptian Hieroglyphics it is complete, " & @LF & @LF & _
    "Click the Copy Button and past into your mail program and click send.;" & @LF & @LF & _
    "When you receive a Encrypted message. I suggest you use EDIT SELECT ALL and EDIT COPY to Select the Encrypted message  " & @LF & @LF & _
    "and then paste it into the Encryption window. The reason is the Encrypted message is one LONG line of code " & @LF & _
    " and will reach 50,000 characters before making a new line. Type in the password and Encryption level" & @LF & _
    "Now you may click the Decryption button and read your safe and secure from all prying eyes personal message," & @LF & @LF & _
    "NOTE:: If your computer is used by others, you can secure all manner of messages, notes, letters, memo's " & @LF & _
    "and the like with this program." & @LF & @LF & _
    "LAST A HINT.. CALL or send a post or a email, to the person(s) whom you share this program " & @LF & _
    "and decide on a password and Encryption level you will use, and use the same settings for all messages," & @LF & _
    " " & @LF & _
    "If You Forget Either The Password Or Encryption Level That Message Is Lost Forever!" & @LF & _
    "Christine", 0)




        EndSwitch
    WEnd ; Continue loop untill window is closed
    Exit
EndFunc   ;==>_Main

Also thank you TheSaint for Dialog Maker, it makes a great help popup.

So how do we make the encrypted string decrypt correctly on different operating systems and processors?

The back story is Flyboy's oldest daughter just reconnected to her father, and wants to make

peace, However daughter number 2 who lives with the oldest daughter is still filled with bad things. and the oldest daughter is worried if her sister finds messages from their Father to her the house will implode,

I thought a easy answer was to encrypt messages,, boy was I wrong.

 

 

Many thanks for reading,,

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I got an idea ... but that will make you work out about it... in totaly different way than your original script.

If you cant dialog directly exe(64) to exe(32)

You can do that... Diablog with a  *.INI file

You send a message in ini file.... crypted or not ... then the other guy reading the ini file insteed of receving the message directly... dont know if that will be still in the randge of what you need but this is a start ?

I dont scripted a lot of crypting things... so i cant explain you why you got that problem. o:)

Edited by caramen

Share this post


Link to post
Share on other sites

What do _stringencrypt and _stringdecrypt contain?


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

_stringencrypt is very outdated. I have updated your code to use the _Crypt_*** functions, but the encryption is different. I hope this helps you out (If it is not something that you would like to use, that is perfectly fine). :)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\TC128.ico
#AutoIt3Wrapper_Outfile=Flyboy_Personal_Encryption_tool.exe
#AutoIt3Wrapper_Outfile_x64=Flyboy_Personal_Encryption_toolx64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Comment=All purpose text crypt tool
#AutoIt3Wrapper_Res_Description=Flyboy_Personal_Encryption_tool
#AutoIt3Wrapper_Res_Fileversion=2.2.2.
#AutoIt3Wrapper_Res_LegalCopyright=Reardon Studio
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <Crypt.au3> ;<<<<<<<<<<<<<<<<< used for _Crypt_*** functions
#include <String.au3>
#include <MsgBoxConstants.au3>
_Main()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Flyboy_Personal_Encryption_tool
Func _Main()
    Local $WinMain, $CopyButton, $EditText, $InputPass, $InputLevel, $EncryptButton, $DecryptButton, $string
    ; GUI and String stuff
    $WinMain = GUICreate('Jim Smiths (Flyboy) Personal Encryption tool', 800, 400)
    GUISetBkColor(0xA6CAF0)
    GUICtrlSetDefBkColor( 0x00ced1)  ; Creates window
    $EditText = GUICtrlCreateEdit('', 5, 5, 760, 350)   ; Creates main edit
    $InputPass = GUICtrlCreateInput('', 5, 360, 160, 20, 0x21)  ; Creates the password box with blured/centered input
    $InputLevel = GUICtrlCreateInput(1, 180, 360, 50, 20, 0x2001)
    GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)    ; These two make the level input with the Up|Down ability



    $EncryptButton = GUICtrlCreateButton('Encrypt', 350, 360, 105, 35)  ; Encryption button
    GUICtrlSetBkColor($EncryptButton, 0xff4500)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $DecryptButton = GUICtrlCreateButton('Decrypt', 460, 360, 105, 35)  ; Decryption button
     GUICtrlSetBkColor($DecryptButton, 0xe0ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $CopyButton = GUICtrlCreateButton('CopyButton', 570, 360, 105, 35)  ; CopyButton
    GUICtrlSetBkColor($CopyButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$HelpButton = GUICtrlCreateButton('HelpButton', 690, 360, 105, 35)  ; HelpButton
    GUICtrlSetBkColor($HelpButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel('Password', 15, 385)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)   ;;GUISetBkColor(-1,0xA6CAF0
    GUICtrlCreateLabel('Level of encryption 1=low 10=high', 110, 382, 265, 35)  ; Simple text labels so you know what is what
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState()

; Shows window

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $EncryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _Crypt_EncryptData($string, GUICtrlRead($InputPass), $CALG_AES_256)) ; <<<<<<<<<<<<<<< changed to crypt
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain)   ; This turns the window back on
                ;GUISetState(@SW_SHOW, $CopyButton) ; This turns the CopyButton back on
            Case $DecryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, BinaryToString(_Crypt_DecryptData($string, GUICtrlRead($InputPass), $CALG_AES_256))) ; <<<<<<<< need to change the returned binary to a string.
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on  popup
            Case $CopyButton
    GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
    GUICtrlSetState($EditText, $GUI_FOCUS)
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                    ClipPut($string)  ; Add new data to the clipboard.
                ;Run("about.exe")  ; Help about.
            Case $HelpButton
                MsgBox(262208, "Help Information", _
    "Type your message in any application, Outlook, Thunderbird, Office, or" & @LF & _
    "even in the Encryption program, although I did not add Spell Check," & @LF & @LF & _
    "When message is ready paste it into the Encryption window, " & @LF & @LF & _
    "Type in a password and a Encryption level if sending a message to" & @LF & _
    "NASA I recommend Encryption level 10 but for normal use and your" & @LF & _
    "positive NSA is not watching you. Use level One," & @LF & @LF & _
    "Now click the Encrypt Button, When the message looks like Egyptian Hieroglyphics it is complete, " & @LF & @LF & _
    "Click the Copy Button and past into your mail program and click send.;" & @LF & @LF & _
    "When you receive a Encrypted message. I suggest you use EDIT SELECT ALL and EDIT COPY to Select the Encrypted message  " & @LF & @LF & _
    "and then paste it into the Encryption window. The reason is the Encrypted message is one LONG line of code " & @LF & _
    " and will reach 50,000 characters before making a new line. Type in the password and Encryption level" & @LF & _
    "Now you may click the Decryption button and read your safe and secure from all prying eyes personal message," & @LF & @LF & _
    "NOTE:: If your computer is used by others, you can secure all manner of messages, notes, letters, memo's " & @LF & _
    "and the like with this program." & @LF & @LF & _
    "LAST A HINT.. CALL or send a post or a email, to the person(s) whom you share this program " & @LF & _
    "and decide on a password and Encryption level you will use, and use the same settings for all messages," & @LF & _
    " " & @LF & _
    "If You Forget Either The Password Or Encryption Level That Message Is Lost Forever!" & @LF & _
    "Christine", 0)




        EndSwitch
    WEnd ; Continue loop untill window is closed
    Exit
EndFunc   ;==>_Main

P.S. you can use other encryption types with this as well.

"3DES" - $CALG_3DES
"AES (128bit)" - $CALG_AES_128
"AES (192bit)" - $CALG_AES_192
"AES (256bit)" - $CALG_AES_256
 Case "DES" - $CALG_DES
"RC2" - $CALG_RC2
"RC4" - $CALG_RC4

EDIT: You can also check out my Short-Order Encrypter in my signature. It is an encrypt & decrypt GUI with message & file encryption, also drag and drop support. You can use any code from it, but a comment would be nice. ;)

Edited by MikahS

Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

What do _stringencrypt and _stringdecrypt contain?

 

Actually this file IS _stringencrypt and there is not a _stringdecrypt, The functions are provided by the #include <string.au3>

I used the concept from

;============= Encryption Tool With GUI =============

; AutoIt version: 3.0.103

; Language:       English

; Author:         "Wolvereness"

;

; -------encrypt.au3--------------------------

 

_stringencrypt is very outdated. I have updated your code to use the _Crypt_*** functions, but the encryption is different. I hope this helps you out (If it is not something that you would like to use, that is perfectly fine). :)

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=..\Icons\TC128.ico
#AutoIt3Wrapper_Outfile=Flyboy_Personal_Encryption_tool.exe
#AutoIt3Wrapper_Outfile_x64=Flyboy_Personal_Encryption_toolx64.exe
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Comment=All purpose text crypt tool
#AutoIt3Wrapper_Res_Description=Flyboy_Personal_Encryption_tool
#AutoIt3Wrapper_Res_Fileversion=2.2.2.
#AutoIt3Wrapper_Res_LegalCopyright=Reardon Studio
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <GUIConstantsEx.au3>
#include <Crypt.au3> ;<<<<<<<<<<<<<<<<< used for _Crypt_*** functions
#include <String.au3>
#include <MsgBoxConstants.au3>
_Main()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Flyboy_Personal_Encryption_tool
Func _Main()
    Local $WinMain, $CopyButton, $EditText, $InputPass, $InputLevel, $EncryptButton, $DecryptButton, $string
    ; GUI and String stuff
    $WinMain = GUICreate('Jim Smiths (Flyboy) Personal Encryption tool', 800, 400)
    GUISetBkColor(0xA6CAF0)
    GUICtrlSetDefBkColor( 0x00ced1)  ; Creates window
    $EditText = GUICtrlCreateEdit('', 5, 5, 760, 350)   ; Creates main edit
    $InputPass = GUICtrlCreateInput('', 5, 360, 160, 20, 0x21)  ; Creates the password box with blured/centered input
    $InputLevel = GUICtrlCreateInput(1, 180, 360, 50, 20, 0x2001)
    GUICtrlSetLimit(GUICtrlCreateUpdown($InputLevel), 10, 1)    ; These two make the level input with the Up|Down ability



    $EncryptButton = GUICtrlCreateButton('Encrypt', 350, 360, 105, 35)  ; Encryption button
    GUICtrlSetBkColor($EncryptButton, 0xff4500)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $DecryptButton = GUICtrlCreateButton('Decrypt', 460, 360, 105, 35)  ; Decryption button
     GUICtrlSetBkColor($DecryptButton, 0xe0ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
    $CopyButton = GUICtrlCreateButton('CopyButton', 570, 360, 105, 35)  ; CopyButton
    GUICtrlSetBkColor($CopyButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")

$HelpButton = GUICtrlCreateButton('HelpButton', 690, 360, 105, 35)  ; HelpButton
    GUICtrlSetBkColor($HelpButton, 0x00ffff)
    GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlCreateLabel('Password', 15, 385)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)   ;;GUISetBkColor(-1,0xA6CAF0
    GUICtrlCreateLabel('Level of encryption 1=low 10=high', 110, 382, 265, 35)  ; Simple text labels so you know what is what
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUISetState()

; Shows window

While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $EncryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, _Crypt_EncryptData($string, GUICtrlRead($InputPass), $CALG_AES_256)) ; <<<<<<<<<<<<<<< changed to crypt
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain)   ; This turns the window back on
                ;GUISetState(@SW_SHOW, $CopyButton) ; This turns the CopyButton back on
            Case $DecryptButton
                GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                GUICtrlSetData($EditText, 'Please wait while the text is Encrypted/Decrypted.') ; Friendly message
                GUICtrlSetData($EditText, BinaryToString(_Crypt_DecryptData($string, GUICtrlRead($InputPass), $CALG_AES_256))) ; <<<<<<<< need to change the returned binary to a string.
                ; Calls the encryption. Sets the data of editbox with the encrypted string
                ; The encryption starts with 1/0 to tell it to encrypt/decrypt
                ; The encryption then has the string that we saved for later from edit box
                ; It then reads the password box & Reads the level box
                GUISetState(@SW_ENABLE, $WinMain) ; This turns the window back on  popup
            Case $CopyButton
    GUISetState(@SW_DISABLE, $WinMain) ; Stops you from changing anything
    GUICtrlSetState($EditText, $GUI_FOCUS)
                $string = GUICtrlRead($EditText) ; Saves the editbox for later
                    ClipPut($string)  ; Add new data to the clipboard.
                ;Run("about.exe")  ; Help about.
            Case $HelpButton
                MsgBox(262208, "Help Information", _
    "Type your message in any application, Outlook, Thunderbird, Office, or" & @LF & _
    "even in the Encryption program, although I did not add Spell Check," & @LF & @LF & _
    "When message is ready paste it into the Encryption window, " & @LF & @LF & _
    "Type in a password and a Encryption level if sending a message to" & @LF & _
    "NASA I recommend Encryption level 10 but for normal use and your" & @LF & _
    "positive NSA is not watching you. Use level One," & @LF & @LF & _
    "Now click the Encrypt Button, When the message looks like Egyptian Hieroglyphics it is complete, " & @LF & @LF & _
    "Click the Copy Button and past into your mail program and click send.;" & @LF & @LF & _
    "When you receive a Encrypted message. I suggest you use EDIT SELECT ALL and EDIT COPY to Select the Encrypted message  " & @LF & @LF & _
    "and then paste it into the Encryption window. The reason is the Encrypted message is one LONG line of code " & @LF & _
    " and will reach 50,000 characters before making a new line. Type in the password and Encryption level" & @LF & _
    "Now you may click the Decryption button and read your safe and secure from all prying eyes personal message," & @LF & @LF & _
    "NOTE:: If your computer is used by others, you can secure all manner of messages, notes, letters, memo's " & @LF & _
    "and the like with this program." & @LF & @LF & _
    "LAST A HINT.. CALL or send a post or a email, to the person(s) whom you share this program " & @LF & _
    "and decide on a password and Encryption level you will use, and use the same settings for all messages," & @LF & _
    " " & @LF & _
    "If You Forget Either The Password Or Encryption Level That Message Is Lost Forever!" & @LF & _
    "Christine", 0)




        EndSwitch
    WEnd ; Continue loop untill window is closed
    Exit
EndFunc   ;==>_Main

P.S. you can use other encryption types with this as well.

"3DES" - $CALG_3DES
"AES (128bit)" - $CALG_AES_128
"AES (192bit)" - $CALG_AES_192
"AES (256bit)" - $CALG_AES_256
 Case "DES" - $CALG_DES
"RC2" - $CALG_RC2
"RC4" - $CALG_RC4

EDIT: You can also check out my Short-Order Encrypter in my signature. It is an encrypt & decrypt GUI with message & file encryption, also drag and drop support. You can use any code from it, but a comment would be nice. ;)

 

Testing both now.. the crypt update and your cool Short-Order Encrypter waiting to hear from tester I use my XP and Win7/32

and he uses Win7/64 and XP/32/64

something has to work cross platform,

I got an idea ... but that will make you work out about it... in totaly different way than your original script.

If you cant dialog directly exe(64) to exe(32)

You can do that... Diablog with a  *.INI file

You send a message in ini file.... crypted or not ... then the other guy reading the ini file insteed of receving the message directly... dont know if that will be still in the randge of what you need but this is a start ?

I dont scripted a lot of crypting things... so i cant explain you why you got that problem. o:)

 

It is a great idea, however beyond my abilities to implement at this time, First would be the attached INI file in text, which could be clicked on and opened, second if I could hide that is how to get the text into the encryption tool .. and many more.. and way beyond my skill level. or the time period I have.. I am taking time from a project I am making to try and help a friend.

Thank you all. I am trying all suggestions..

3282

Share this post


Link to post
Share on other sites

 

The functions are provided by the #include <string.au3>

This has been removed long ago: this implementation was buggy as hell.

Follow MikahS' advice and use _Crypt* standard functions (garanteed cross-platform).


This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe here
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • RTFC
      By RTFC
      Please answer me these questions three, ere the other side you see:
      Are you running a 64-bit machine with a 64-bit Windows operating system? Can your AutoIt scripts cope with having directive #AutoIt3Wrapper_UseX64=Y, and thus @AutoItX64=True? Are you sick and tired of seeing this error message?
      If you (like me) answered "YES" to all three questions, then the _HighMem library may ease your pain (the name commemorates a useful utility from the days when CPUs were still steam-powered). Forget about pathetic boot switches /3GB and /userva; in a full-fledged 64-bit environment, _HighMem can pre-allocate all available physical/virtual RAM you've got (or any smaller size you need), and manage individual allocations therein with four simple functions:
      _HighMem_StartUp( $nSize, $sUnit="GB" ) ; parse size of total region to pre-allocate, e.g. (10,"GB") _HighMem_Allocate( $nSize, $sUnit="B" ) ; returns $pOffset (new allocation's base address) _HighMem_Release( $pOffset ) ; existing allocations are identified by their offset (base address) _HighMem_CleanUp() ; close handles, release all pre-allocated memory Of course, existing AutoIt limitations remain in force (e.g., DllstructCreate() is still limited to 2 GB per call), but the maximum of 2-4 GB of virtual memory per Windows process can (under the right circumstances, in the proper environment) be circumvented. However, this is the first beta release, so glitches are likely, and performance may vary. In fact, it may not work at all for you (if you're running 32-bit, for example). And since this involves your own hardware, it's unlikely I would be able to reproduce your issues in my own work environment. Nevertheless, if you find obvious bugs or mistakes in the code, please do post. And if it works for you, that's also good to hear. My own motivation for developing it was to supercharge my matrix computing environment (Eigen4AutoIt), so it can handle matrices of any size that fit in machine RAM.
      The attached zip contains the library itself (HighMem.au3) and two test examples. HighMem_Test1 performs a dry run stress test of the allocation management system; it does not actually do any memory I/O. By contrast, HighMem_Test2 pre-allocates a 6 GB space, stores 3 x 2GB structs there, performs some basic I/O, and releases the allocations one by one. Obviously, for this to work you'll need at least that much free RAM to begin with (check with Task Manager -> Performance -> Memory if you're unsure). My own test environment has 16 GB of physical RAM, and runs W10Pro/64.
      EDIT: minor edits added to improve user experience (many more status messages if $_HighMem_Verbose=True)
      HighMem.v0.85.7z
      EDIT: from beta version 0.9, HighMem supports shared memory, including mutex negotiation.
       
      HighMem.v0.91.7z
    • iXX
      By iXX
      Hi!
      Looking for working code to  get full path of process  - both 32 & 64 bit.
      I tryed this bellow, but it works only for 32-bit processes, even if compiled for x64...
      Thanx for suggestions!
       
      Func _ProcessGetPath($vProcess) ;get the program path done by MrCreatoR Local $iPID = ProcessExists($vProcess) If NOT $iPID Then Return SetError(1, 0, -1) Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID) If NOT IsArray($aProc) OR NOT $aProc[0] Then Return SetError(2, 0, -1) Local $vStruct = DllStructCreate('int[1024]') Local $hPsapi_Dll = DllOpen('Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@SystemDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then $hPsapi_Dll = DllOpen(@WindowsDir & '\Psapi.dll') If $hPsapi_Dll = -1 Then Return SetError(3, 0, '') DllCall($hPsapi_Dll, 'int', 'EnumProcessModules', _ 'hwnd', $aProc[0], _ 'ptr', DllStructGetPtr($vStruct), _ 'int', DllStructGetSize($vStruct), _ 'int_ptr', 0) Local $aRet = DllCall($hPsapi_Dll, 'int', 'GetModuleFileNameEx', _ 'hwnd', $aProc[0], _ 'int', DllStructGetData($vStruct, 1), _ 'str', '', _ 'int', 2048) DllClose($hPsapi_Dll) If NOT IsArray($aRet) OR StringLen($aRet[3]) = 0 Then Return SetError(4, 0, '') Return $aRet[3] EndFunc  
    • FMS
      By FMS
      Hello,
      I think this is a simple question if you know the answer.
      At this function i try to  (encrypt -> decrypt -> change -> encrypt ->decrypt->check ) an array.
      This is a snippet from a larger script but the error is the same.
      I do this encrypt decrypt action so i can save some setting along the way in a file.
      But at the end (when i change the data and not when i dont change the data) is empty.
      does somebody see what i'm doing wrong here?
       
      Func test() Local $LC_timestamp = @MDAY & "." & @MON & "." & @YEAR & "_" & @HOUR & ":" & @MIN & ":" & @SEC Global $GL_USS_base_count = 4 Global $GL_USS_base[$GL_USS_base_count][2] = [["nickname", "FMS"], ["last_login", $LC_timestamp], ["login_count", "1" ], ["naam3", $LC_timestamp]] Global $encrypted_GL_USS_true[$GL_USS_base_count] Global $encrypted_GL_USS_content_true[$GL_USS_base_count] Global $GL_array_decrypted_USS_names[$GL_USS_base_count] Global $GL_array_decrypted_USS_settings[$GL_USS_base_count] MsgBox($MB_SYSTEMMODAL, "should be 1", $GL_USS_base[2][1]) ;make for $i = 0 to $GL_USS_base_count -1 $encrypted_GL_USS_true[$i] = _Crypt_EncryptData($GL_USS_base[$i][0], $GL_encr_key_settings, $CALG_AES_128) $encrypted_GL_USS_content_true[$i] = _Crypt_EncryptData($GL_USS_base[$i][1], $GL_encr_key_settings, $CALG_AES_128) Next ;get for $i = 0 to $GL_USS_base_count -1 $GL_array_decrypted_USS_names[$i] = binarytostring(_Crypt_DecryptData(binary($encrypted_GL_USS_true[$i]), $GL_encr_key_settings, $CALG_AES_128)) $GL_array_decrypted_USS_settings[$i] = binarytostring(_Crypt_DecryptData(binary($encrypted_GL_USS_content_true[$i]), $GL_encr_key_settings, $CALG_AES_128)) Next MsgBox($MB_SYSTEMMODAL, "should be 1", $GL_array_decrypted_USS_settings[2]) ;change $GL_array_decrypted_USS_settings[2] = $GL_array_decrypted_USS_settings[2] + "1" MsgBox($MB_SYSTEMMODAL, "should be 2", $GL_array_decrypted_USS_settings[2]) ;save for $i = 0 to $GL_USS_base_count -1 $encrypted_GL_USS_true[$i] = _Crypt_EncryptData($GL_array_decrypted_USS_names[$i], $GL_encr_key_settings, $CALG_AES_128) $encrypted_GL_USS_content_true[$i] = _Crypt_EncryptData($GL_array_decrypted_USS_settings[$i], $GL_encr_key_settings, $CALG_AES_128) Next ;get for $i = 0 to $GL_USS_base_count -1 $GL_array_decrypted_USS_names[$i] = binarytostring(_Crypt_DecryptData(binary($encrypted_GL_USS_true[$i]), $GL_encr_key_settings, $CALG_AES_128)) $GL_array_decrypted_USS_settings[$i] = binarytostring(_Crypt_DecryptData(binary($encrypted_GL_USS_content_true[$i]), $GL_encr_key_settings, $CALG_AES_128)) Next ;check MsgBox($MB_SYSTEMMODAL, "should be 2", $GL_array_decrypted_USS_settings[2]) ;why is this emty????? EndFunc thanks in advanced
    • FMS
      By FMS
      Hello,

      I'm having trouble whit a scipt what I'm building where this is a snippit from, and hope somebody can help me whit.
      The problem lies in when i push the "add" button i want to check if the "user" already exists.
      But the search code i build founds 2 hits when i know there is only 1 hit.
      does somebody knows what I'm doing wrong?
      thanks in advance.

      Ps. if somebody knows " if i found the right user how can i rewrite the password for him/her? " an answer to that will be most appriciated
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <Array.au3> #include <FileConstants.au3> #include <MsgBoxConstants.au3> #include <WinAPIFiles.au3> #include <File.au3> #Include <Timers.au3> #include <Crypt.au3> #include <GuiEdit.au3> $Form1 = GUICreate("Pie", 170, 235, 190, 200) local $usernames[0] local $passwords[0] global $selectuser = GUICtrlCreateCombo("", 21, 95, 130, 20) $addusername = GUICtrlCreateButton("Add", 21, 170, 130, 30) $usernamefield = GUICtrlCreateInput("", 21, 120, 130, 20) $passwordfield = GUICtrlCreateInput("", 21, 145, 130, 20, 0x0020) func encrypt() Local $hFileOpen = FileOpen("data.srmt", $FO_APPEND) if guictrlread($usernamefield) <> "" then ;~ local $encryptedusername = string(guictrlread($usernamefield)) ;~ local $encryptedpassword = string(guictrlread($passwordfield)) local $encryptedusername = string(_Crypt_EncryptData(guictrlread($usernamefield), "P14h735536jk3fvvbg", $CALG_AES_128)) local $encryptedpassword = string(_Crypt_EncryptData(guictrlread($passwordfield ), "P14h735536jk3fvvbg", $CALG_AES_128)) Local $iCheck_hit = False ConsoleWrite (@CRLF & "##############################################"& @CRLF) if ubound($usernames)> 0 then for $i = 0 to ubound($usernames)-1 If guictrlread($usernamefield) = $usernames[$i] Then $iCheck_hit = True ConsoleWrite ( "Found! "& @CRLF & $usernames[$i] & " = " & guictrlread($usernamefield) & @CRLF & "i = " & $i & @CRLF & @CRLF) ;~ Else ;~ ConsoleWrite ( "No! "& @CRLF & $usernames[$i] & " = " & guictrlread($usernamefield) & @CRLF & "i = " & $i & @CRLF & @CRLF) EndIf next EndIf ConsoleWrite ( "##############################################"& @CRLF) If $iCheck_hit = False Then FileWrite($hFileOpen, $encryptedusername & @CRLF) FileWrite($hFileOpen, $encryptedpassword & @CRLF) EndIf EndIf FileClose($hFileOpen) EndFunc func decrypt() Local $hFileOpen = FileOpen("data.srmt", $FO_READ) ;~ consolewrite(_FileCountLines("data.srmt") & " lines in the file" & @CRLF) for $i = 1 to _FileCountLines("data.srmt")/2 local $encryptedusername = FileReadLine($hFileOpen) local $encryptedpassword = FileReadLine($hFileOpen) ;~ consolewrite($encryptedusername & @CRLF) ;~ consolewrite($encryptedpassword & @CRLF) ;~ _ArrayAdd($usernames, FileReadLine($hFileOpen)) ;~ _ArrayAdd($passwords, FileReadLine($hFileOpen)) _ArrayAdd($usernames, binarytostring(_Crypt_DecryptData(binary($encryptedusername), "P14h735536jk3fvvbg", $CALG_AES_128))) _ArrayAdd($passwords, binarytostring(_Crypt_DecryptData(binary($encryptedpassword), "P14h735536jk3fvvbg", $CALG_AES_128))) Next FileClose($hFileOpen) ;~ consolewrite(ubound($usernames) & " entries in array") ;~ _arraydisplay($usernames) if ubound($userNames)> 0 then for $i = 0 to ubound($usernames)-1 GUICtrlSetData($selectuser, $usernames[$i]) next EndIf endfunc func updatecomboandinfo() if not GUICtrlRead($usernamefield) = "" Then _ArrayAdd($usernames, GUICtrlRead($usernamefield)) _ArrayAdd($passwords, GUICtrlRead($passwordfield)) GUICtrlSetData($selectuser, $usernames[UBound($usernames)-1]) EndIf EndFunc decrypt() GUISetState(@SW_SHOW) While True $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $addusername updatecomboandinfo() encrypt() GUICtrlSetData($usernamefield, "") GUICtrlSetData($passwordfield, "") Case $selectuser if ubound($usernames)> 0 then for $i = 0 to ubound($usernames)-1 ;~ msg( "error",$array_decrypted_usernames[$i]) If $usernames[$i] = GUICtrlRead($selectuser) Then GUICtrlSetData($usernamefield, $usernames[$i]) GUICtrlSetData($passwordfield, $passwords[$i]) consolewrite("YES " & $i & " = " & $usernames[$i] & " | ctr = " & GUICtrlRead($selectuser) & @CRLF) Else ;~ msg( "error",$array_decrypted_usernames[$i]) consolewrite("NO " & $i & " = " & $usernames[$i] & " | ctr = " & GUICtrlRead($selectuser) & @CRLF) EndIf next EndIf EndSwitch WEnd