1

I am asking specifically about AES CBC mode.

Is it safe to assume that an encryption key of length X with N characters known by an attacker is just as secure as a key of length X − N?

For example, is the following key:

[][][][][]abc (8 chars, 3 known)

Exactly as secure as:

[][][][][] (5 chars, 0 known)

assuming that the rest of the key cannot be guessed from the known characters?

Does the placement of the known characters make any difference?

Would it increase security at all to add a known value to an encryption key (for example, by using a 256 bit key instead of a 128 bit key but making the last 128 bits static)? Or would it actually make the key weaker? Or make no difference at all?

  • 1
    AES keys cannot be chosen with an arbitrary length. For AES-128, the key must be 128 bits length. For AES-256, the key must be 256 bits in length. Perhaps you are thinking of some sort of key derivation function, where a key is derived from some arbitrarily chosen password of any length. – mti2935 May 12 at 15:13
  • @mti2935 I don't think the OP is suggesting variable key lengths. Merely that a subset of the string is known. – schroeder May 12 at 15:16
  • Hi @schroeder In that case, I'm confused by the phrase, '.. is just as secure as a key of length X − N?' in the question. – mti2935 May 12 at 15:20
  • @mti2935 what I meant by that is whether the key would then be just as strong as a shorter key, not that it would actually be shorter. Though my last paragraph may have been a bit confusing so I've edited it a bit. – TR_SLimey May 12 at 15:43
  • @schroeder that's right – TR_SLimey May 12 at 15:44
2

"Does the placement of the known characters make any difference?"

Yes, it does make a difference and a rather significant difference. When it comes to information, the more the attacker knows the faster he can break it, as simple as that.

If the attacker knows where a b c goes in your key, then again it is as good as,

[][][][][] (5 chars, 0 known)

is the same as,

[]a[]b[]c[][]
[]abc[][][][]
abc[][][][][]

If you want a key of length 8 and 3 chars are to be considered known values, then the true length of the key/secret is simply 5.

If an attacker knows the value at position X, position Y, position Z, the attacker can include that in brute-forcing the key. You basically shortened the time taken to obtain the full key. You removed a nice chunk of combinations for him. You can have a key with 10 digits of random numbers. If you add a string of numbers like 1234567890 behind it, so it becomes XXXXXXXXXX1234567890, its a 20 digit key now, it is useless. It's as good as 10. Another example > X1X2X3X4X5X6X7X8X9X, if the attacker knows the position of the known values, again it's as good as a key length of 10.

Also, what is the relation of the revealed values to the key? Like if a b c is revealed & a b c won't appear again, then that is a huge clue to be handing out, again shortening the time it takes to brute-force it and undermining the integrity/overall effectiveness of the key.

Let me reiterate, (5 known & 3 known) = (5 known) both has the same level of integrity provided that the values are not related to each other

| improve this answer | |
  • By placement I meant, whether it makes a difference if the attacker knows the starting, ending or middle values (but the same number of each). Also, does this mean that there is absolutely no benefit to increasing key length with known values? Or are there some attacks which might be prevented simply by having a longer key? – TR_SLimey May 12 at 15:52
  • If an attacker knows the value at position X, position Y, position Z, the attacker can include that in brute-forcing the key. You basically shortened the time taken to obtain the full key. You removed a nice chunk of combinations for him. You can have a key with 10 digits of random numbers. If you add a string of numbers like 1234567890 behind it, so it becomes XXXXXXXXXX1234567890, its a 20 digit key now, its useless. It's as good as 10. X1X2X3X4X5X6X7X8X9X, if the attacker knows the position of the known values, again it's as good as a key length of 10. – mallocation May 12 at 16:04
  • 1
    Alright. Thanks. Just wanted to make sure. My primary concern was whether part of the key being known somehow compromised the rest of the key, or made it easier to guess based on the ciphertext and the known part, but if I understood correctly, that's not the case and instead the key remains as secure as its unknown part? – TR_SLimey May 12 at 16:16
  • Yeap the key remains as effective as its unknown part. Giving the known values away doesn't give the unknown values away (unless its a dictionary word), the overall integrity of the key would be way better with 8 unknown vs (5 unknown & 3 known). Again let me reiterate, (5 known & 3 known) = (5 known) same level of integrity provided that the values are not related to each other. I will make some changes to the post above. – mallocation May 12 at 16:24

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.