Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  1. Suppose I have a random number (eg 625 467 921). I use it once to encrypt a message OTP style, and when I want to use them again, I reverse them (eg to 129 764 526) and use to encrypt the other message. What is the weakness of this scheme?

  2. Again, suppose I have some random numbers (again, eg 625 467 921). When I want to use them again, I add a static value to each number (eg adding $4$ modulo $10$, the numbers will be 069 801 365) and use these new values for the second message. For the 3rd message, I add to the numbers $6$ or $7$ etc. I keep using the same base numbers for each message, and all I need to encrypt is the number to add to the last used numbers. Will these numbers be random? What is the weakness in the scheme?

share|improve this question
What do you assume about the attacker? Does the attacker know the process, just not the initial random number? This would be the most natural assumption if you follow kerchoffs' principle. If you don't follow that principle, you are building on unstable grounds. – mikeazo Dec 17 '12 at 12:22
up vote 4 down vote accepted

A standard assumption in cryptography is that an attacker knows everything about your cryptosystem, apart from the key. This is known as Kerckhoffs's principle. Taking a look at your construction under this assumption, shows that it's extremely weak.

  1. is unkeyed and can be trivially reversed by an attacker. So you end up with something that amounts to a two-time-pad, and that's not very secure.
  2. The second one uses a keyed transformation, essentially a caesar cipher. Apart from this transform you're once again reusing a one-time-pad. Since the caesar cipher has a very small key, your security gain over plain one-time-pad reuse is just as small. Still extremely weak.
share|improve this answer
well, I think I'll start reading a little about crypto analyzing, and little math. thanks – illsecure Dec 17 '12 at 20:25

What you are essentally describing is a Pseudo-Random Generator in which the base numbers act as the seed. This does not make a good method for generating OTPs because if you know the seed then you just work from there and crack the message.

share|improve this answer
That's not really the reason. With a secure pseudorandom number generator, a long enough seed and some assumptions it would be secure, just not OTP. – otus Sep 17 '15 at 15:56
Generating a pad from a smaller seed can be computationally secure, in fact that's what stream ciphers do. But of course this is not secure against a computationally unbounded adversary. – CodesInChaos Sep 17 '15 at 17:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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