5
$\begingroup$

I've been looking into different ciphers that require very minimal computation power (calculator, deck of cards, index cards and a pencil), i.e. hand ciphers. For the most part all methods typically discussed are considered insecure with the advent of computers. Searching for patterns, testing against linguistic statistics, etc. are all simple to perform with computers let alone just having a small key space and not requiring a lot of operations (which is a requirement of a hand cipher).

So I was thinking, what if you were to incorporate a Block Cipher Mode into a hand cipher. How much more secure would it become? Most BCM don't require a lot of additional effort so the power required by a human wouldn't be ridiculous. And hopefully they would provide some protection from the operations a computer can do to intelligently decipher the key/plaintext.

Lets use the Two-Square Cipher and Output Feedback Mode.

If we allow both squares to use all upper case letters and 0-9 we have 36 characters possible in a 6x6 square. That is a key space of

36! x 36! = 1.378e83

A 256 bit key would be 2^256 = 1.158e77 so I'd think our hand cipher has a pretty good start.

I picked Output Feedback Mode because you can't perform parallelized decryption and it contains a single operation. There are lots of modes but I thought this would be simple enough for the point. Pick a better one, my use here is just to get rid of the fact that Two-Square is just a map between Ciphertext and Cleartext.

Lets say we encrypt a 10 character message. Its very short, can't really use any type of analysis on the data to guess at the key or plaintext (even though the BCM would hopefully resolve those concerns). For really simple math, lets make the following assumptions for the operations required to perform the decryption:

  • Block Cipher Encryption: 1 operation per character (its a lookup table of two points)
  • XOR Encryption and Plaintext/Ciphertext: 1 operation per character

To make these even more simple, we'll assume there is no cost for loading data, or anything else. Not realistic but I/O is always a bottleneck in anything we do so we'll skip it.

A 10 character Ciphertext would require 20 operations to decrypt assuming you had the key. If we say that the average brute force method should take half of the key space to break a system we'd have

20 * (1.378e83 / 2) = 1.378e84 operations

Looks like the fastest i7 chip currently can do 240,000 MIPS so bad math shows us that

1.378e84 ops / 240,000 MIPS = 5.742e72 seconds

Or 1.821e65 years.

So what is it that I'm missing here because that seems like a pretty simple algorithm, with a huge load of work to brute force even for a very small message. I know I'm using rough numbers, but even 1/1,000,000 of that is still a huge amount of time. If the Block Cipher Mode can allow for even larger messages without giving away statistical information about the message, wouldn't this constitute a pretty secure method of encryption? And because humans are slow and lazy, no one would really want to encrypt huge tomes of data by hand. So really a short letter shouldn't be that simple to crack.

Edit:

Just to make it a little more clear, here is the Wikpedia image of Output Feedback:

Output Feedback Block Cipher Mode

The Block Cipher Encryption step would just be using the Two-Square cipher (rather than something like AES). So basically my question boils down to, if you have a big enough key space, a small enough cipher text, can a very simple encryption algorithm provide security?

Edit 2

Each character can be mapped to a numerical value. A=1, B=2, 0=27, etc. Since XOR is a little difficult for the human brain to perform, you could add two characters together on encryption and subtract them on decryption. A+B=C, C-B=A. If you roll over the end of your list, you start at the beginning. 8 + C = B Subtraction works the same way.

The question is really about the fact that most classical ciphers had flaws based on their dependence on the clear text and independence on other cipher text or any other data. For example, if two characters in clear text appear in the same block multiple times, they produce the same cipher text values. But what if these classic ciphers were used for pseudo random stream generation? Unless you are generating large amounts of data, shouldn't many of the flaws of classic ciphers be minimized or completely removed?

$\endgroup$
5
  • $\begingroup$ I'm probably missing something, but where's the block cipher? Why do you think that a mode of encryption would somehow increase the complexity of the underlying cipher? $\endgroup$
    – Maarten Bodewes
    Mar 28, 2016 at 22:01
  • $\begingroup$ The faults of Two Square is that the cipher text directly maps to clear text so frequency can be used to attempt to decipher the key. If that flaw were to be removed then you'd have an OK algorithm that is nothing like AES but still not instantly cracked via brute force. $\endgroup$
    – jecxjo
    Mar 28, 2016 at 22:35
  • 1
    $\begingroup$ People are not that good at doing binary operations, and I don't think that the output of the two-step cipher is binary either. So you would have to do additional mapping. You cannot just connect classical ciphers and modern modes of operation. Try and create a formal description and a simple program implementing this; that should not be too hard, right? $\endgroup$
    – Maarten Bodewes
    Mar 28, 2016 at 23:32
  • $\begingroup$ Instead of true XOR it would be adding for encryption and subtraction for decryption. A=1, B=2 so A "pseudo xor" B would be C. I made a list of letters and their corresponding numbers and I can do the lookup in 2Square and "Xor" with a calculator at a rate of a dozen or so characters a minute. $\endgroup$
    – jecxjo
    Mar 28, 2016 at 23:58
  • $\begingroup$ I think that RC4 is probably doable by humans, since you just need 256 numbered cards to swap around and a preprinted XOR table to help the human do the XORs required. It's not a block cipher, though, like you wanted. It's also not secure by modern standards, but is rather strong among ciphers with small keys feasible for humans. $\endgroup$
    – Myria
    Jan 14, 2017 at 3:46

2 Answers 2

7
$\begingroup$

what if you were to incorporate a Block Cipher Mode into a hand cipher

That line is a bit misleading and hints at a potential misunderstanding. A "mode of operation" is more something you wrap around a block cipher… not something you incorporate or embed into a cipher algorithm.

if you have a big enough key space, a small enough cipher text, can a very simple encryption algorithm provide security?

Generally speaking: yes.

The probably most well-known example would be OTP (One Time Pad) where the key space is as large as the message to be encrypted/decrypted.

And you can even push that assumption ad absurdum if you want, by going double-OTP etc. In the end, your sub-question will start and end with asking yourself "how much security" you expect and "how much inconvenience" you are willing and/or able to handle (think: key exchange, key storage, etc.) to achieve that level of security.

Yet, things like the Two-Square Cipher you mention are pretty different and provide way less information-theoretical security than OTP… to say the least. And that’s exactly the point where my “Generally speaking: yes.” quickly turns into a “In that case: no.” (with a strong urge to add the usual byline: “please, don’t even think about it when you really expect cryptographic security”.)

Looks like the fastest i7 chip currently can do 240,000 MIPS so bad math shows us that…

That may be more relevant when talking about things like brute-force attacks, but even when assuming that to be the main attack vector – keep in mind that brute-force attackers will most definitely use faster things like dedicated ASICs, FPGAs, and/or whole “computing farms” to ensure they attack at optimal speed.

Now, compare that to your comment where you say

with a calculator at a rate of a dozen or so characters a minute

…and the fact that you’ll not even be using 2⁸ bits per char.

I’ll keep it short by saying that your gut feeling should already hint at the fact you won’t have much of a chance winning that race and a mode of operation isn’t a magic shield that makes weak or broken ciphers stronger. Individual weaknesses will still be there; you’ll just be wrapping them in a nice gift paper for an attacker to unwrap. This may cause a minor hickup for the attacker, but it won’t save your message as the cipher flaws are still existent and (in most cases) detectable. In the end, what you hope to gain by applying a mode of operation will be voided by a problem at the core: the weak or broken cipher algorithm.

As for your main question:

How secure would hand ciphers be using a Block Cipher Mode?

That depends on the cipher, the mode, the message, the key, … the whole scenario. So, actually there are too many things that would need to be considered to answer your main question in a way that would both be satisfying for you, as well as fit into this little answer box.

But one thing is for sure: a mode of operation won’t fix a weak or broken cipher. It’s not what modes of operation are made for; it’s not what a mode of operation is meant to do. Therefore, you can’t really expect modes of operation to fix a weakness within a block cipher algo. Sure, a mode of operation may (or may not) hide some or maybe even all flaws of a block cipher. But that won’t provide any kind of cryptographic security (only obscurity) while all those flaws that may come with a weak or broken cipher algorithm will still be propagated with the ciphertext.

$\endgroup$
0
5
$\begingroup$

Block cipher modes of operation don't complicate the crypt-analysis of the underlying cipher (much). They are required to create a CPA secure cipher out of a block cipher (using a random IV, and making sure that the rest of the ciphertext is chained to this IV somehow). Sometimes error propagation is also used for very specific purposes. In other words, the mode of operation relies on the security of the underlying block cipher, not the other way around. So applying a mode of operation to a classical cipher won't make it much more secure. It will be only slightly more difficult to analyze.

Besides that, a classical cipher generally outputs characters. Modes of operations have been defined for modern block ciphers that operate on bits. So out of the box, a classical cipher cannot be used as input for a mode of operation. You would have to define how the input and output of the classical cipher would be mapped to binary.

$\endgroup$
1
  • $\begingroup$ @jecxjo Comments are not for extended discussion; this conversation has been moved to chat. $\endgroup$
    – e-sushi
    Mar 29, 2016 at 1:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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