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?

  • $\begingroup$ Sorry I Was unprecise i mean numerals from 0-9 $\endgroup$ – user65597 Feb 9 '19 at 17:19
  • 1
    $\begingroup$ "Schneier's Law": "Anyone, from the most clueless amateur to the best cryptographer, can create an algorithm that he himself can't break." $\endgroup$ – zaph Feb 9 '19 at 17:24
  • $\begingroup$ 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 $\endgroup$ – user65597 Feb 9 '19 at 17:26
  • 1
    $\begingroup$ 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. $\endgroup$ – zaph Feb 9 '19 at 17:34
  • $\begingroup$ 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. $\endgroup$ – 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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.