Yes. I'll start now.
I have been been working on the important question you had raised.
I have a solution now, but I'll post that later.
I will update this function soon.
Thanks.
Yes. I'll start now.
I have a solution now, but I'll post that later.
Code: Select all
Original := A_AhkPath . "\..\licsssense.txt"
Encrypted := "license.txt.aeaaaaa"
KeyPhrase := "unbent-snugly-mousy-swivel-collide" ; Phrase generated @ https://www.useapassphrase.com/
FileCryptFile("encrypt", Original, Encrypted, KeyPhrase)
FileCryptFile("decrypt", Encrypted, Decrypted, KeyPhrase)
I can't put a MsgBox inside code. It has to be outside the function.
Code: Select all
SetWorkingDir, %A_ScriptDir%
Original := A_AhkPath . "\..\licsssense.txt"
Encrypted := "license.txt.aeaaaaa"
KeyPhrase := "unbent-snugly-mousy-swivel-collide" ; Phrase generated @ https://www.useapassphrase.com/
FileCryptFile("encrypt", Original, Encrypted, KeyPhrase)
If (ErrorLevel)
MsgBox % ErrorLevel
Code: Select all
If (ErrorLevel)
MsgBox % ErrorLevel
else
MsgBox Done
Code: Select all
If not FileCryptFile("encrypt", Original, Encrypted, KeyPhrase)
MsgBox % ErrorLevel
Code: Select all
; http://autohotkey.com/board/topic/90702-encrypt-decrypt-text/
; https://www.autohotkey.com/boards/viewtopic.php?t=5838
; ===================================================================================
; AHK Version ...: AHK_L 1.1.11.01 x64 Unicode
; Win Version ...: Windows 7 Professional x64 SP1
; Author ........: Originated from jNizM, tweaked by Soft
; Script ........: EnCrypt_DeCrypt.ahk
; Description ...: Encrypt & Decrypt Data
; License .......: WTFPL
; ===================================================================================
; GLOBAL SETTINGS ===================================================================
#NoEnv
#SingleInstance force
#Include Crypt.ahk
#Include CryptConst.ahk
#Include CryptFoos.ahk
; SCRIPT ============================================================================
Gui, Margin, 10, 10
Gui, Font, s10, Segoe UI
Gui, Add, Edit, xm ym w300 h120 vStr hwndEditEnDecrypt, Enter text or drag file to en/decrypt here.
Gui, Add, Edit, xm y+5 w300 vStr2, Password
;Gui, Add, Edit, xm y+5 w300 vStr2 hwndEditPw,
;EM_SetCueBanner(EditPw, "Password")
Gui, Add, Edit, xm y+10 w300 h120 vEnDeCrypt ReadOnly, En/Decrypted text appears here and is also copied to the clipboard!
Gui, Add, DropDownList, xm y+5 w300 AltSubmit vEncryption, RC4 (Rivest Cipher)
|RC2 (Rivest Cipher)
|3DES (Data Encryption Standard)
|3DES 112 (Data Encryption Standard)
|AES 128 (Advanced Encryption Standard)
|AES 192 (Advanced Encryption Standard)
|AES 256 (Advanced Encryption Standard)||
Gui, Add, Button, xm-1 y+10 w300, Copy
Gui, Add, Button, xm-1 y+15 w100, Encrypt
Gui, Add, Button, xm+201 yp w100, Decrypt
Gui, +LastFound
Gui, Show,, En/Decrypt
WinSet, Redraw
Return
ButtonCopy:
Gui, Submit, NoHide
GuiControl,, Copy, Copy
ControlGet, OutputVar, Selected,,,
;MsgBox % OutputVar
Clipboard := OutputVar
StringReplace, Clipboard, Clipboard, %A_Space%, , All
;MsgBox % Clipboard
MsgBox, 96, Your Selection, %Clipboard%, 1 ; No sound!
Send, !{Tab}
Return
ButtonEncrypt:
Gui, Submit, NoHide
GuiControl,, EnDeCrypt, % Crypt.Encrypt.StrEncrypt(Str, Str2, Encryption, 1)
Clipboard := % Crypt.Encrypt.StrEncrypt(Str, Str2, Encryption, 1)
Return
ButtonDecrypt:
Gui, Submit, NoHide
GuiControl,, EnDeCrypt, % Crypt.Encrypt.StrDecrypt(Str, Str2, Encryption, 1)
Clipboard := % Crypt.Encrypt.StrDecrypt(Str, Str2, Encryption, 1)
Return
GuiDropFiles:
if A_GuiControl = Str
{
Draged := FileOpen(A_GuiEvent, "r")
GuiControl,, Str, % Draged.Read()
}
Return
; EXIT ==============================================================================
GuiClose:
GuiEscape:
ExitApp
EM_SetCueBanner(hWnd, Cue)
{
Static EM_SETCUEBANNER := 0x1501
Return DllCall("User32.dll\SendMessage", "Ptr", hWnd, "UInt", EM_SETCUEBANNER, "Ptr", True, "WStr", Cue)
}
Hello
Sure.Just tested your function in Linux Mint under Wine 5.14 and it works just fine. Assuming I won't starve in the mean time (no joke here) I'll try to update MyDiary for x64 compatibility and use your function with it if it's okay with you.
No, its not you.On another note and completely unrelated, when you get some spare time could you pretty please take a look at the issue in this topic and confirm or deny my finding? There's been no feedback whatsoever for too long and I just don't know if it's me or something else. Worse thing is Wine also yields the same ugly result since forever and as such all my scripts that use a similar technique (including MyDiary) look bad.
Thank you and wish you the same.Thanks again and all the best to you!
I was stupid enough to store a debit card info in a text file on my desktop. I was never able to "erase" it. Data retrieval software always found it.
If your data is less than 16 MB, then my upcoming lib for compression and encryption would be a better choice.The idea of 7-zip compression is actually a good one, if only for the fact that 7-zip supports password encryption which would make usage of this function superfluous.
I have a function to erase files along with any associated ADS. It fills the file with random data, truncate to 0 byte then delete it.Drugwash wrote: ↑29 Apr 2021, 16:07NTFS has those ADSes (Alternate Data Streams) that may hold data even after it's been erased. Some good forensic software should be aware of that and clean those up properly.
Just recently I saw in some application - might've been Double Commander, can't remember - an option to perform a certain number of passes when deleting a file/folder. Maybe you should consider switching to Linux (dunno if DC has a Windows version and if such feature would be available there too, in case it actually was it the application in cause).
I know what it is called, but would avoid the "word". Google shouldn't know what I know.Your idea of hiding data in a picture would be good if it weren't old already. It's called steganography and has been used for a long time to pass secret messages. Chances are the online AI is trained to detect such hidden data and retrieve it, so my friendly opinion would be for you to never ever post such kind of files online, or your privacy would be much much quicker invaded than leaving the data in the clear in a text file on the desktop.
Law can do B&E doesn't mean there is no safety in keeping doors locked.Besides, all encryption libraries have backdoors for the three-letter-agencies to butt in and decrypt
I disagree. There is a large middle-ground between the extremes.so such effort would only be justified against the random nosy parents or siblings or friends.
Late is OK. I highly value your input.Drugwash wrote: (sorry for late replies, not getting e-mail notifications and tend to forget a lot of things including checking the forums)
Return to “Scripts and Functions (v1)”
Users browsing this forum: No registered users and 75 guests