Jump to content

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


Recommended Posts

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,,

Link to comment
Share on other sites

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

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
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)

Link to comment
Share on other sites

_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

 

Link to comment
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
Link to comment
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)

Link to comment
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
 Share

×
×
  • Create New...