I figured that a really secure password would be an AES 128 key. If this key were to be base 64 encoded, I could replace 4 random bytes in it in order to make it unusable unless you know which bytes were replaced and by what.

The process would be like this:

1. generate a key: [²ú·0ýóQS%ô6
2. base64 encode it to make it readable: iVuy+rcw/fNRU56AiiX0Ng==
3. replace 4 random bytes of it iVuy+icw/fNRG5oAiiJ0Ng==
1. I would remember what the 4 bytes are i.e. the password
2. the computer would remember which bytes got changed (in this case: 13, 6, 19, 15) and in what order

My question is: how difficult (how many attempts) would it be to guess the correct key if you got hold of the original.

Another way of asking this is: how long has the key to be in order to make it difficult (several decades of guessing with a super computer) with changing just 4 random bytes.

I guess there is a simple mathematical formula to calculate this. But I don't know it.

• a ciphertext encrypted under your key;
• a copy of the key with $k$ bytes erased; and
• knowledge of which $k$ bytes have been erased.

The adversary can try to decrypt the ciphertext and decide if the decryption makes sense in time $T$.

To find the key, the adversary need only do $2^{8k}$ trial decryptions, for a total time cost of $2^{8k} T$.

The key point is that there's usually no sensible way to make $T$ big.

Ergo, when $k$ is $4$, this is obviously easy.

• thank you for your answer but the assumption is not entirely true. The adversary knows the key but he does not know the number of bytes nor the places nor the order – Micha Roon Dec 22 '14 at 9:28
• sorry, the adversary knows how many bytes, but not which ones – Micha Roon Dec 22 '14 at 10:05
• Clarify your question, then add a n choose k. By the way, if you replace bytes in the Base64 expansion, you should use 6 above, not 8. – K.G. Dec 22 '14 at 17:55