Sign in to follow this  
Followers 0
goldenix

Secure password generator

2 posts in this topic

#1 ·  Posted (edited)

will this do or should i try make it better?

Btw does it mater if i have 100 key files or 10 key files in terms of security?

$string = "!'#$%&/()+,-.:;\@[]" & "^{" & "|}~" & '"'

For $a=1 To 9999

    $upper = Chr(Random(Asc("A"), Asc("z"), 1))

    $lower = Random(1,9,1)

    If Random() < 0.5 Then  ; Returns a value between 0 and 1.
        ConsoleWrite($upper)
        
    ElseIf Random() > 0.5 Then 
        ConsoleWrite($lower)
        
    ElseIf Random() > 0.9 Then
        ConsoleWrite(' ')
        
    Else
        ConsoleWrite(StringMid($string,Random(1,25),1))     
    Endif
    

Next

ConsoleWrite(@CRLF)
Edited by goldenix

My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You might want to seed your random number generator with something difficult to predict first.

local $seed = TimerInit()
for $ii = 0 to 100
  ToolTip("Move the mouse around to generate randomness")
  $seed = BitRotate(BitXOR($seed, MouseGetPos(0) * MouseGetPos(1)), 1, "D")
  sleep(10)
next
ToolTip("")
SRandom($seed)

I'm sure there's a better way, but I'm not sure what it would be.

Edit: Revised the code to make the mouse motion have more of an effect on the randomness

Edited by theyranos

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0