Bruce Schneier's Password 2

Some progress for the future me: The problem can be reduced to a Combination Sum problem. In particular, we can generate the range of possible primes as the sum of the array (range can be from ord(a) * <some_value> to ord(z) * 1020). We can use a DP approach to solve this as we have a lot of incremental sum, however, storage might be an issue. Some trimming can be done to ensure the solution does not exceed the length How the array....

April 12, 2024 · 2 min · qvinhprolol

Bruce Schneier Password

We will exploit the fact that numpy’s array class is int64. So, what we’re gonna do is basically generate random passwords, with digits, lowercase and uppercase letters and hope that one of these passwords have both sum and product (overflowed) prime. For this, we need password with three restrictions: It is large enough for the overflow to occur All the digits are odd (if we have any even digit, the product will be even, and therefore not prime) The length must be odd, so the sum will also be odd, as prime numbers should be odd numbers only I guess the last criteria is luck....

January 6, 2023 · 2 min · qvinhprolol