AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Generate password per site and manage without memorizing all

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Fri May 16, 2008 10:39 am    Post subject: Generate password per site and manage without memorizing all Reply with quote

IT'S JUST AN EXPERIMENT YET, DO NOT USE IT FOR REAL

here's my small idea.
to generate unique password per site and manage it without memorizing them all.
there's no elegant algorithm. just simple method

it generates password depend on the domain name.
so you don't have to memorize them all
all you need to memorize is single password that you've set
even if the site changes their domain name, password can be easily restored
if you know the former domain name and your password
and it doesn't create/read file or registry, generates passwords in realtime everytime
it works like this

1) set your numeral password at startup (length of 1-6, 6 is recommended)
2) connect to any web site (support only IE compatible browser for the moment)
3) focus at password form in the browser
4) press WIN + X
5) you'll get your unique password entered

my two cents

IF YOU WANT TO USE THIS FOR REAL CHANGE THE ALGORITHM TO YOUR OWN FOR SECURITY
Code:

#NoEnv
Menu,Tray,NoStandard
Menu,Tray,Add,Restore Password,Restore
Menu,Tray,Add,Exit,Exit

Title=Input Your Root Password
SetTimer, ControlChange, 50     ;for applying style and msg to edit control
InputBox, RootPassword, %Title%,,, 200, 100
Return
;#############################auto execution end################################
ControlChange:
  WinWait, %Title%
  PostMessage, 0x00C5, 6,,Edit1,  ;EM_LIMITTEXT = 0x00C5
  Control, Style, +0x2000, Edit1  ;ES_NUMBER = 0x2000
  ControlGet, Current, Style,, Edit1,
  If Current=0x50012080           ;check if above changes has been applied
    SetTimer, ControlChange, Off
Return

#x::                          ;Win+x
  Hex:="" , Pos:=""               ;reset
  ControlGetText, URL, Edit1, A   ;get url from address bar in IE
  GetDomain(URL)                  ;strip domain name only from the url
  SetFormat, Integer, H


;_______________________________________________________________________________
;         C H A N G E  T H I S  T O  Y O U R  O W N  A L G O R I T H M
;_______________________________________________________________________________
  Loop {
    Pos++
    If (Asc(SubStr(URL,Pos,1))=0x0) ;no more characters in domain
      Break
    Else
    {
      If Mod(Asc(SubStr(URL,Pos,1)),2)=0
        Hex+=Asc(SubStr(URL,Pos,1)) ^ Mod(A_Index,pos) ;sum ascii numbers of all characters in domain name
      Else
        Hex+=Asc(SubStr(URL,Pos,1)) & Mod(A_Index,pos)
    }
  }
  passwd:=(Hex*RootPassword)  ;simply multiply hex with provided Root password
  StringReplace, Passwd, Passwd, 0x, % Chr(93+StrLen(URL)) ;some sites doesn't allow to use password starting with numbers
;_______________________________________________________________________________
;         C H A N G E  T H I S  T O  Y O U R  O W N  A L G O R I T H M
;_______________________________________________________________________________



  SendInput, %passwd%{ENTER}        ;disabled while experiment
Return

ToolTipOff:
  ToolTip
  SetTimer, ToolTipOff, Off
Return

Restore:
InputBox, URL, Password Restore,Input URL to Restore,,300,120
  Hex:="" , Pos:=""               ;reset
  GetDomain(URL)                  ;strip domain name only from the url
  SetFormat, Integer, H
  Loop {
    Pos++
    If (Asc(SubStr(URL,Pos,1))=0x0) ;no more characters in domain
      Break
    Else
    {
      If Mod(Asc(SubStr(URL,Pos,1)),2)=0
        Hex+=Asc(SubStr(URL,Pos,1)) ^ Mod(A_Index,pos) ;sum ascii numbers of all characters in domain name
      Else
        Hex+=Asc(SubStr(URL,Pos,1)) & Mod(A_Index,pos)
    }
  }
  passwd:=(Hex*RootPassword)  ;simply multiply hex with provided Root password
  StringReplace, Passwd, Passwd, 0x, % Chr(93+StrLen(URL)) ;some sites doesn't allow to use password starting with numbers
  clipboard:=passwd
  ToolTip, Restored Password is %passwd% `nSaved in clipboard
  SetTimer, ToolTipOff, 2500
Return

Exit:
Exitapp

GetDomain(Byref URL)            ;strip domain name only from the url
{
IfNotInString, URL, http://
  URL := "http://" . URL
SplitPath, URL,,,,,URL
StringReplace, URL, URL, http://
StringGetPos, Dot1, URL, ., R3
StringGetPos, Dot2, URL, ., R2
StringGetPos, Dot3, URL, ., R1
StringMid, Ext, Url, dot3+2
If (Dot1=-1 && Dot2!=-1)       ;case) www.domain.com (two dots in url)
{
  If StrLen(Ext)=3             ;for .com / .net / .org ...
    StringMid, URL, URL, Dot2+2
  Else If StrLen(Ext)=2        ;for .kr / .de / .fr / .us ...
    StringMid, URL, URL, Dot1+2
  Else                         ;for co.kr / or.kr / co.jp ...
    StringMid, URL, URL, Dot1+2
}
Else If (Dot1=-1 && Dot2=-1)   ;case) domain.com (one dot in url)
  StringMid, URL, URL, 1
Else
  StringMid, URL, URL, Dot1+2  ;case) www.domain.co.kr (three dots in url)
Return URL
}

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com


Last edited by heresy on Sat May 17, 2008 9:41 am; edited 3 times in total
Back to top
View user's profile Send private message
System Monitor



Joined: 09 Mar 2007
Posts: 392
Location: Unknown

PostPosted: Sat May 17, 2008 12:31 am    Post subject: Reply with quote

Did you the idea from http://lifehacker.com/software/passwords/geek-to-live--choose-and-remember-great-passwords-184773.php Very Happy
_________________
Back to top
View user's profile Send private message Visit poster's website
heresy



Joined: 11 Mar 2008
Posts: 291

PostPosted: Sat May 17, 2008 9:30 am    Post subject: Reply with quote

no, not really.
english isn't my mother language,
so i rarely read english blogs even though lifehacker is popular
although it came from my own. i don't even think it's kind of unique idea.
mixing domain name with personal rule.
there's no unique idea at all
how you express the idea is making things unique in my opinion
_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group