Page 1 of 1

Zip file to store passwords

Posted: 08 Nov 2021, 05:48
by roysubs
I would like to have an plain text file on my hard disk that holds some information that I want to secure, so I would like it to be zipped up in a password protected zip file (this is more than enough security for my needs).
I would like the first time that I access this file when my AHK file is loaded to ask me for the password, and then hold onto that password in a variable for the duration of the AHK file being loaded such that it opens the zip file and can read / alter the text file that is in there (i.e. without creating a temp file ideally, read the file into memory and then write the file back into the zip file). After I restart my AHK script, I would need to re-input the password the first time.
Does anyone have some templates that could help get me started with doing this? Tasks like:
• Create a zip file from a text file
• Opening the zip file, request password, then hold that password for all subsequent access
• Read contents of file inside zip file into memory, then modify it as required, then update the file into the zip file

Re: Zip file to store passwords  Topic is solved

Posted: 08 Nov 2021, 05:58
by mikeyww
This may help. http://www.autohotkey.com/forum/viewtopic.php?t=65401

7zip is also handy. https://www.7-zip.org/

InputBox could ask the user for a password. It has a "Hide" parameter that is useful for passwords.

I use Total Commander to manage files, and I think that it more or less does all of what you described, though of course, any modification to the file's contents are done by the user. I do not know whether temporary files are created, but I imagine so.

Re: Zip file to store passwords

Posted: 08 Nov 2021, 07:18
by roysubs
I use 7zip for most things yes, and ok, I'll look at the Hide parameter, thanks.

You mean you use Total Commander for tasks like this manually, or you mean that you automate Total Commander functions from AutoHotkey? I'd be interested to see how that works.

Re: Zip file to store passwords

Posted: 08 Nov 2021, 07:42
by mikeyww
Just manually; it might not serve your purpose.

7zip has a robust command line. WinRAR does, too, but I believe that it comes with a fee.

Re: Zip file to store passwords

Posted: 08 Nov 2021, 08:16
by Johnny R
Perhaps fSekrit helps you. Its freeware and fine for my daily use...

Re: Zip file to store passwords

Posted: 09 Nov 2021, 03:27
by Capn Odin
You are basically trying to make a password manager, why not just use one of the already tried and tested password managers available? Personally I use keepass 2.