AutoHotkey Community

It is currently May 27th, 2012, 10:37 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: June 15th, 2005, 2:54 am 
Offline

Joined: May 4th, 2005, 7:07 pm
Posts: 16
Try this:

Code:

Code:
Password = pass

InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %Password%
gosub, InvalidPass

else
   If InputPass = %Password%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return

InvalidPass:
   MsgBox, 16, Access Denied, Invalid Password.
ExitApp
return

Script_PostValidate:
; ....:: Your Script ::... ;



Not sure y it wasn’t working correctly but think this way it should work as it was intended 2. :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Password modification
PostPosted: October 25th, 2007, 10:48 pm 
Hello, thank you for the password script.


I currently have the need to create a password that changes month to month and I am the only one who knows what it is for that month (after I create a script of course )
The user has to request of me the password each month to go into the script I created.
Does anyone have any ideas on how this could be done? Maybe the "password script" can analyze the date and then it will use the appropriate password i specified for that date range or month.

OR perhaps some kind of formula that changes the password month to month, that would be pretty slick too.

Thank you for your help and time in this matter.


Report this post
Top
  
Reply with quote  
 Post subject: changing password
PostPosted: October 26th, 2007, 12:51 am 
Here is what I came up with to have a monthly changing password:

Code:
Code:
intTempNumber := A_MM * 4 -6
InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %intTempNumber%
gosub, InvalidPass

else
   If InputPass = %intTempNumber%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return

InvalidPass:
   MsgBox, 16, Access Denied, Invalid Password.
ExitApp
return

Script_PostValidate:
; ....:: Your Script ::... ;


You can have whatever combination you want and it changes each month.


Report this post
Top
  
Reply with quote  
 Post subject: modification on my code
PostPosted: October 26th, 2007, 1:22 am 
Hello does someone have a good formula to make the password not so evident if the months change.

for instance 10 * 4 -6 = 34
next month 38
next month 42

As you can see this is easy to figure out if the passwords are saved.
Perhaps a formula that does something like

20
82
102
153
182
193

and so on. As you can see it is very hard to figure out the formula

Thanks for the thoughts


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2007, 9:06 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
:idea:

The simplest method I can think of is:

Code:
FormatTime, yymm,, yyMM
MsgBox, % NumGet( yymm )


You may use just MM if you want to.

:)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 27th, 2007, 9:26 pm 
I am sorry, but could you put the code:

Code:
FormatTime, yymm,, yyMM
MsgBox, % NumGet( yymm )



Where exactly do I put this :?: in the code that I modified below.

Code:
intTempNumber :
FormatTime, yymm,, yyMM
MsgBox, % NumGet( yymm )

InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %intTempNumber%
gosub, InvalidPass

else
   If InputPass = %intTempNumber%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return

InvalidPass:
   MsgBox, 16, Access Denied, Invalid Password.
ExitApp
return

Script_PostValidate:
; ....:: Your Script ::... ;


I apologize for not understanding. Thanks for your time.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2007, 10:31 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
Code:
intTempNumber:

FormatTime, yymm,, yyMM
intTempNumber := NumGet( yymm )


InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %intTempNumber%
gosub, InvalidPass

else
   If InputPass = %intTempNumber%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return

InvalidPass:
   MsgBox, 16, Access Denied, Invalid Password.
ExitApp
return

Script_PostValidate:
; ....:: Your Script ::... ;


:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 27th, 2007, 11:40 pm 
Forgive me for my ignorance, but how does this little code work. Is it in the manner where I can specify a number for whatever month and year it is. If so where do i put my list of numbers.

I translate this as NumGet (yymm) to get some number that I specified for the yymm.

Is this the way it works?

Thanks for your time.


Report this post
Top
  
Reply with quote  
PostPosted: October 28th, 2007, 8:24 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
newpie wrote:
Maybe the "password script" can analyze the date and then it will use the appropriate password i specified for that date range or month.

OR perhaps some kind of formula that changes the password month to month, that would be pretty slick too.


I was answering to the second part of the question.
It is hard to explain how this NumGet() works, but I can assure you that it generates a unique number ( 32bit Integer ) - for every month - for whole of the current century.

You do not need a password list with this technique.
For example, If you ever need to know what the password will be for year:2019 and month:10, then you may run the following code to see it:

Code:
FormatTime, yymm, 201910, yyMM
MsgBox, % NumGet( yymm )


If you want to generate results for the whole century, try the following:

Code:
Date := 20000101000000

Loop 1200 {

FormatTime, yymm, %Date%, yyMM
FormatTime, yyyymmm, %Date%, yyyy/MMM
list .= yyyymmm " = " NumGet( yymm ) "`n"
ldom := ldom( Date )
EnvAdd,Date, %ldom%, Days

}

FileDelete, passlist.txt
FileAppend, %list%, passlist.txt
Run, passlist.txt
Return


LDOM(TimeStr="") {
; Laszlo : http://www.autohotkey.com/forum/viewtopic.php?p=54502#54502
  If TimeStr=
     TimeStr = %A_Now%
  StringLeft Date,TimeStr,6 ; YearMonth
  Date1 = %Date%
  Date1+= 31,D              ; A day in next month
  StringLeft Date1,Date1,6  ; YearNextmonth
  Date1-= %Date%,D          ; Difference in days
  Return Date1
}


Conclusion:
I have shown you a way on how to generate a unique number based on the year and month of the calendar date.
You may further process this unique number to differentiate it between many users, like:
Assign a numeric user-id for every user and some formula to make sure that the password is different for every user.

Hope I was clear.

:)


Last edited by SKAN on November 3rd, 2007, 10:12 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2007, 1:14 pm 
Answering your question if you were clear, Yes very much so :) , thank you so much for your time in answering my questions.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 28th, 2007, 2:01 pm 
Offline

Joined: June 17th, 2007, 7:45 pm
Posts: 161
Location: C:\
d3m0n1x wrote:
Try this:

Code:

Code:
Password = pass

InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %Password%
gosub, InvalidPass

else
   If InputPass = %Password%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return

InvalidPass:
   MsgBox, 16, Access Denied, Invalid Password.
ExitApp
return

Script_PostValidate:
; ....:: Your Script ::... ;



Not sure y it wasn’t working correctly but think this way it should work as it was intended 2. :roll:


this work perfectly
but can somebody make a more complex script with password change option also?
so that there is another button called "change password" witch refers you to a new gui or msgbox where you have to enter the old pass and the 2 times the new one
something like all the password changers we all know
it would be nice if somebody could make it

_________________
Signature oO


Report this post
Top
 Profile  
Reply with quote  
PostPosted: October 28th, 2007, 3:50 pm 
The main purpose of this script is to produce a safeguard against users copying and distributing the script with semi-control. So this way they have to ask you the password every so often, for updates or whatever.

This is a modification of the script below:

Code:
intTempNumber:

FormatTime, yymm,, yyMM
intTempNumber := NumGet( yymm )

InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %intTempNumber%
gosub, InvalidPass

else
   If InputPass = %intTempNumber%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return


Since It generates a random number you can even make the formula even harder to crack in case they are searching thru the internet by adding some functions to the end of the code. It also can make it a shorter number to make it easier to enter for the users. For example:

Code:
intTempNumber:

FormatTime, yymm,, yyMM
intTempNumber := NumGet( yymm ) - 1000 ;<---You can add whatever you want at the end to customize it and make it a shorter number making it easier to enter as a password

InputBox, InputPass, User Authentication, Enter Password:
If ErrorLevel = 1 ;Cancel Pressed
   {
   MsgBox, 48, Cancel, User cancelled`, script will terminate
   ExitApp
   }
else
   {
   If InputPass != %intTempNumber%
gosub, InvalidPass

else
   If InputPass = %intTempNumber%
   MsgBox, 64, Access Permitted, Welcome user
      Goto, Script_PostValidate
   }
Return


I appreciate everyone's time


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2007, 2:58 am 
Offline

Joined: November 3rd, 2007, 12:41 am
Posts: 188
@TeknoMusicMan

I also saw the RC4 but it is a bit faulty with certain lucky encodings.

try this one:
http://www.autohotkey.com/forum/viewtopic.php?t=6804

Laszlo coded some extensions on it to be sure no characters are ever lost!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 3rd, 2007, 3:49 am 
Offline

Joined: August 27th, 2007, 8:00 pm
Posts: 179
Chris wrote:
But as Serenity said, be sure to specify a password when compiling so that no one else can decompile the script.

I don't understand.
If a compiled exe needs to be safe, then why specify a password at all?
Its not openable at all with ahk2exe in that case, right?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, chaosad, specter333 and 74 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group