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

A message is sent from a person to another. The plain message is first encrypted, even with a weak algorithm - say, DES. Then, the encrypted message is encoded with a simple substitution, which is private and remains the same through all the conversation.

Is it feasible for an external attacker to decrypt the message, only knowing the encrypted message and the process (i.e. only that an unknown encryption and later an unknown substitution, both of which remain the same through all the conversation)?

The substitution algorithm, the encryption algorithm and any key the algorithms use are private and known to both the sender and the receiver. The substituted text may be longer than the non-substituted one.

My guess so far is that since frequency analysis can usually not be applied to encryption, a simple substitution makes it infeasible to decrypt the text, provided that the map (knowing what is encoded to what) remains unknown

share|improve this question
In a known plaintext scenario with known algorithms(but unknown substitution table) this is barely harder to break than plain DES. – CodesInChaos Jan 28 '14 at 17:51
How "simple" is your simple substitution? It sounds like the cost of breaking DES would be by far the most significant part of this. – figlesquidge Jan 28 '14 at 17:52
When analyzing modern crypto we observe Kerckhoffs's principle i.e. we assume algorithms are known, only keys are secret. Ciphertext-only analysis isn't considered much either, known plaintext is one of the weakest attacks considered. Typical schemes must be secure against much stronger attacks where an attacker can choose the message to encrypt/decrypt. Nobody will take a scheme serious that's so weak that the designer insists on ciphertext only analysis. – CodesInChaos Jan 28 '14 at 17:54
@CodesInChaos How is decoding the message trivial, if the substitution table is unknown? There are potentially infinite (well, not really) substitution tables - there are 2! substitution tables which map one bit to another, 4! tables mapping two bits to another two bits, and so on - not counting tables that map n bits to n+k bits. For long encrypted messages, it seems nontrivial to me to test all possible substitution tables. – Giulio Muscarello Jan 28 '14 at 19:21
There are not infinite substitutions, and you are also limited by the block size of the cipher, and by how effectively a computer can generate large s-boxes, so you are probably going to use between a 6 and 16-bit sbox, meaning 65000 times harder at most, but likely less. – Richie Frame Jan 28 '14 at 19:51

Your Answer


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

Browse other questions tagged or ask your own question.