IRC: #akmu @ QuakeNet



Create account!
Password length (between 4 and 99 characters)

Download source: PassuGen.tar
Hide source
crackthisup_module.php:
<?php
/* * * * *
 * Password related functions
 * 13.03.2019
 * (c) Niilo "acri" Virtanen
 * * * * */

class CrackThisUp {
    function 
mkpw($length$buffer) { //Create new random password
        
$atoz range('a''z'); //Letters from a to z
        
$atozcaps range('A''Z'); //Same but capitalized
        
$nums range(09); //Numbers from 0 to 9
        
$characters array_merge($atoz$atozcaps$nums); //Array with possible characters for password
        
$cc count($characters); //Count possible characters
        
$cc--; //Minus 1 for correct amount
        
file_put_contents("buffer.txt"""); //Clear buffer
        
$password ""//Empty password
        
for($i 0$i $length$i++) { //Loop till password is fully made
            
$random random_int(0$cc); //Random number for picking one character from array of characters
            
$letter $characters[$random]; //Pick character for password
            
$password .= $letter//Add character to password
            
if(strlen($password) == $buffer) {
                
file_put_contents("buffer.txt"$passwordFILE_APPEND); //Write password to buffer
                
$password "";  //Clear password variable (Memory usage things)
            
}
        }
        
file_put_contents("buffer.txt"$passwordFILE_APPEND); //Write password to buffer
        
$password file_get_contents("buffer.txt"); //Get password from buffer
        
file_put_contents("buffer.txt""");
        return 
$password//Return password
    
}
}
?>

passugen.php:
<?php
$start 
microtime(true); //Start timer
require_once("crackthisup_module.php"); //CrackThisUp Module
require_once("ctu.conf"); //Config
$ctu = new CrackThisUp();
$i 0;
while(
$i $amount) { //Loop while all passwords are created
    
$passu $ctu->mkpw($length$buffer); //Create password
    
echo "Salasana: ".$passu."\n";
    
$i++;
}
$stop microtime(true); //Stop timer
$time $stop $start//Calculate used time
echo "Luotiin $amount kappaletta "strlen($passu)." merkin salasanaa $time sekunnissa!\n";
echo 
"Muistia k√§ytettiin: "memory_get_peak_usage(true) ." tavua!\n";
?>

ctu.conf:
<?php
$amount 
1//Amount of passwords generated
$length 123456//Lentgh of passwords
$buffer 10000//Buffer size
?>

buffer.txt: