Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Password management
Message
De
28/05/2013 07:20:01
 
 
À
28/05/2013 04:19:07
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01574811
Message ID:
01574910
Vues:
36
>Haven't figured out the total number of permutations yet
>
>Say, 6 chars with at least one digit
>
>I can put the digit in the first position, second, third, ... sixth
>
>So that would be 6 * 52^5 * 10 which is 52^5 * 60 and this is greater than 52^6

Couldn't resist a quick play:
       private static void Main(string[] args)
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();
            foreach (string s in GetValidPasswordList())
            {
                Console.WriteLine(s);
            }
            Console.WriteLine(watch.Elapsed);
            Console.ReadLine();
        }

        public static IEnumerable<string> GetValidPasswordList()
        {
            int total = 0;
            for (int x = 1; x<63; x++)
            {
                for (int y = 1; y<63; y++)
                {
                    for (int z = 0; z < ((y < 53 && x < 53) ? 63 : 11); z++) //24 seconds
                    //for (int z = 0; z < 63; z++ ) // 31 seconds
                    {
                        yield return string.Format("{0}.{1}.{2}  (Total:{3})", x, y, z, total++);
                    }
                }
            }
        }
Couldn't be bothered with real chars but the principle's the same. 24 seconds v 31
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform