# How secure is a 4 digit seed?

When I Use a 4 digit random number(e.g. 4468) as seed for a (manual) Stream cipher and straddle it to the length of the plaintext using a lagged fibonnacci generator, can this seed be found by brute force?

• Sorry I Was unprecise i mean numerals from 0-9 – user65597 Feb 9 '19 at 17:19
• "Schneier's Law": "Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break." – zaph Feb 9 '19 at 17:24
• I was about to realize how breakable it is I asked this question for a scientific clarification and proof. So to quote Schneier is in that case not one hundred percent appropriate – user65597 Feb 9 '19 at 17:26
• Simply put it would take no more than 10000 tries with an average of 5000 tries. Keep in mind that the attacker is not limited to manual methods. When trying "seeds" only enough of the message need be decrypted to determine if a trial "seed" is correct so it can be very fast. – zaph Feb 9 '19 at 17:34
• That's clearly about 16 to 17 bits of security (divide the number of digits + 1 by 3 and multiply by ten, or just notice that 10000 is rather close to 65536). That's about nothing. Things start to get secure from 64 bits onwards for rather short term protection. Real security is considered about 112 bits or higher and generally you'd aim for 128 to 256 bits of security. – Maarten Bodewes Feb 13 '19 at 6:13

Assuming by "digit" you mean "base-10 number"...

There are $$10^4$$ different combinations.

$$\log_2(10^4) \approx 13$$

It would require no more than $$2^{13}$$ guesses to guess every single possible seed. This assumes that the seed is uniformly random.

Even using python on relatively modest hardware, it takes .001 seconds to iterate over all the possible seeds.

So yes, it is easily guessable.

You would require at least $$2^{64}$$ cost to become merely inconvenient rather than trivially guessed.

The minimum size for it to be considered secure is 128 bits. That would correspond to roughly 39 uniformly random base-10 digits.

• Thank you for the Fast reply. Now I know how insecure my cipher really is – user65597 Feb 9 '19 at 17:22
• Extending the seed to 128 bits should be no problem – user65597 Feb 9 '19 at 17:39
• I used to open this 4-digit numbered locks less than 1 minute. – kelalaka Feb 9 '19 at 18:09
• Is there a Tool to test the strenght of the seed – user65597 Feb 9 '19 at 21:37
• @user65597 What do you mean by test the strength of the seed? Test it for strength against what? – Ella Rose Feb 9 '19 at 22:31