Lasitha Alawatta wrote:
I’m going to create all key combinations; simple-letter passwords and store those in to MySql DB.Using = a-z (simple letters) Password length = 6 Number of possibilities = 26 x 26 x 26 x 26 x 26 x 26 = 308,915,776 This is my code: <?php for($i=0;$i< 500000000;$i++){ $arrPwd[] = createPwd(); } $arrUniqueData = array_unique($arrPwd); foreach($arrUniqueData as $key=>$val){ // Inserting to DB } function createPwd() { $lower = "abcdefghijklmnopqrstuvwxyz"; $seed_length += 26; $seed .= $lower;for($x=1;$x<=6;$x++){$ strPwd.= $seed{rand(0,$seed_length-1)}; } return($strPwd); } ?> What is the easiest way to get my output? 1. Because above code will stuck the PC (for($i=0;$i< 500000000;$i++){). 2. I use 500000000 instead of 308915776, because createPwd() function will duplicating the password. Suggesting, comments, code samples are highly appreciate.
The only reason I can see to do such a thing is to build a brute-force password cracker, and seeing as you're not smart enough to realise that you can do so incrementally instead of randomly, I don't see much reason to help you.
Enjoy. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
