A password window!!

Post your working scripts, libraries and tools for AHK v1.1 and older
Kamal Awasthi
Posts: 22
Joined: 19 Aug 2015, 04:35
Contact:

A password window!!

24 Aug 2015, 00:52

Code: Select all

/*
*************************************************
How to run.

1.reads the the content of password.txt as password and matches it with the entry give by the user.
2. To run the script and test it just make a txt file namely password.txt in the same folder .
3. Launch the password window with the shortcut [winKey]+[p] after compiling the script.

*********************************************************
*/

/*
USES:
You can use this script to mask any personal app of yours wuth a password window.
*/


;password window
#o::

global Array := Object()
Loop, Read,password.txt                                           ;LOOP TO READ THE BUTTON FILE
{
    Array.Insert(A_LoopReadLine) 

}     

InputBox, password, Welcome!Enter Password, Enter the Password , hide
if  password=                           ;IF NONE IS SELECTED , RETURN
return

if (password=Array[1])
 MsgBox Correct password
 else
{  MsgBox Incorrect Password,Try again by Launching the app again.
}
Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: A password window!!

26 Aug 2015, 08:19

This provides no real security at all, since you have to store your password as plain text.
But here is some improvement suggestion:
-don't save the password, instead save its SHA512 hash.
-check the entered password by comparing the hashes.
-encode the script that you want to mask with the password, and only if the hash comparison succeeds, decode it with the entered password. For all of this you could use https://github.com/ahkscript/libcrypt.ahk
Have a nice day! :)
"Nothing is quieter than a loaded gun." - Heinrich Heine
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: A password window!!

27 Aug 2015, 07:47

Alibaba wrote: -encode the script that you want to mask with the password, and only if the hash comparison succeeds, decode it with the entered password.
I have a question: how do you do that ? Can you gave me an quick example please.
Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: A password window!!

27 Aug 2015, 10:40

ozzii wrote:Can you gave me an quick example please.
Sure! I wrote a little example, it's very self explaining, just download the attachment and try it by starting the Encrypt.ahk ;)
encrypt_script.zip
(9.58 KiB) Downloaded 153 times
Btw, it is using the Crypt lib by Deo: http://www.autohotkey.com/board/topic/6 ... n-hashing/
"Nothing is quieter than a loaded gun." - Heinrich Heine
ozzii
Posts: 481
Joined: 30 Oct 2013, 06:04

Re: A password window!!

28 Aug 2015, 03:48

Thanks I will look into this
Kamal Awasthi
Posts: 22
Joined: 19 Aug 2015, 04:35
Contact:

Re: A password window!!

28 Aug 2015, 04:40

I just wrote the script to having toe an idea about posting on forum.But i think, it was a nice thing to do. You gave me knowledge about encrypting and security field. I will surely look for your idea.
Kamal Awasthi
Posts: 22
Joined: 19 Aug 2015, 04:35
Contact:

Re: A password window!!

28 Aug 2015, 04:47

And I used this script to have a mask on the script having the list of the hidden files. So every time i want to open any hidden file you will have to enter the password will will eventually run the script for that window. And you can also hide the files of this script, so that no one comes tyo know about your password. But anyways, thanks for your valuable idea. I will look forward to it. Thank You very much.
Alibaba
Posts: 480
Joined: 29 Sep 2013, 16:15
Location: Germany

Re: A password window!!

28 Aug 2015, 05:07

Of course it's perfectly fine to use this script on your own machine. I just wanted to warn you that this method isn't safe, regardless of hiding files, compiling scripts, etc...
It's only important that you don't give this script to anyone else to use, calling it protected.
"Nothing is quieter than a loaded gun." - Heinrich Heine
Kamal Awasthi
Posts: 22
Joined: 19 Aug 2015, 04:35
Contact:

Re: A password window!!

31 Aug 2015, 00:31

Ok!! I will mark your words.And thanks for the ecryption script you provided.

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: No registered users and 104 guests