Is it possible to generate every possible combination of a 32 character alpha numeric string? If so, how long would it take on today's fast computers?My lecturer at university said it's impossible, and I thought nothing is impossible.Any ideas on how long it'd take and how it'd be done? We're using Java at the moment. I would like to think I can prove him wrong.
Generating every combination of a 32 character alpha numeric string?
java;php;algorithms;cryptography
It boils down to the math, even if you take pretty crazy values.  Let's say you have an instruction that can generate one 32 character combination in one cycle.  Also, you're not storing these combinations so there is virtually no memory access. Finally let's assume that your effective clock speed for these instructions is 2.0 petahertz (ten to the fifteenth cycles per second), which doesn't exist yet outside of the fastest supercomputers on the planet.The number of 32 character combinations that are alphanumeric with repetition is 36 to the 32nd power.  So, 10 to the 32nd power is a much smaller lower bound on this value.  To compute this smaller group, you will need 10 to the 17th seconds (combinations / clock speed).  There's approximately 32 million seconds in a year, so for this example, we'll take 100 million seconds as 3 years to make the math easy.  So that leaves us with 10 to the 17th seconds being divided by 10 to the 8th seconds per 3 years.  That means it will take more than 3 billion years for this computation to complete.  Check that against the estimated time we have left before our sun becomes a red giant, that's just 5 billion years....