1
$\begingroup$

This is more of a mental exercise for me than anything else. I've thought about doing something like this before, mostly to make a broken cipher a little more difficult to decrypt to plain text. I've simplified the strategy below, but in theory, you could use any length of replacement key first.

First, I would randomly choose a number of known length (say 4 digits). Let's use 1976 as an example. Then, I take the plain-text string, and do the following:

convert the string into a byte array. for the first byte, i add 1. for the second byte, i subtract 9. for the third byte, i add 7, and for the fourth byte, i subtract 6. I repeat this throughout the byte array, then rebuild the string from the byte array. Next, I concatenate the 1976 key to the front of the string. Once that is done, I use standard AES 256 encryption.

Now, in practice, I would use more than just adding and subtracting and a longer integer value, but that gives an example of the "randomization" of the string prior to encryption. The idea is to provide an extra layer of randomness to the encryption scheme. However, I'm not sure if this provides any real value as if the IV/Key has already been obtained then how hard is it really to figure out what I'm doing with the appended integer? Would it be better to use this post-encryption? I'm really curious what the community thinks of this idea. Does it have any merits? What are the drawbacks? How good/bad of an idea is it really?

$\endgroup$
  • 2
    $\begingroup$ It has no merit, and it has the drawback of being silly. Just use a good cipher. $\endgroup$ – fkraiem Mar 11 '16 at 17:38
1
$\begingroup$

"However, I'm not sure if this provides any real value as if the IV/Key has already been obtained then how hard is it really to figure out what I'm doing with the appended integer?"

If the adversary has your key, then you have already lost, and there is little that can be done besides generating a new one and keeping it safe. The IV is considered public information and does not need to be kept secret, and does not need measures applied to attempt to keep it secret.

Would it be better to use this post-encryption?

No, it would not improve anything to use this transformation after application of the AES.

I'm really curious what the community thinks of this idea. Does it have any merits?

The internals of a cipher often permute or shuffle the data somehow, in addition to the substitutions they usually do. That itself is a good idea.

You basically are suggesting a simple substitution. Substitution is an important part of an substitution permutation network. Combinations of substitutions and permutations (shuffles), combined with key interaction, can indeed make a strong cipher. The AES is built off of these principles.

The exact transformation that you mention is not particularly novel or capable. Typically the substitution layer is performed via the application of an S-Box, which is very fast, or in situations where resistance to timing attacks is desired, some kind of non linear function that operates in constant time

What are the drawbacks? How good/bad of an idea is it really?

However, your substitution is totally unnecessary if you are going to be encrypting with AES. The AES is by itself, already secure. Your modification would not improve this fact.

Worst case scenario, your modification could somehow open up a weakness that you had not considered. For example, what key were you planning on using to apply your substitution? Rarely do ciphers use the master key directly in their operations, usually they apply a key schedule first, as this can create a layer of separation between the "real" key and the round key used to actually do the work. Your transformation, considered in isolation, appears to be weak to known plaintext attack that could lead to key recovery.

Long story short, some form of substitution isn't just a good idea for a cipher, it's necessary. However, the AES was literally designed for this purpose, and does a good enough job already.

$\endgroup$

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.