I want to encrypt a key file, which is assumed to be truly random (generated with hardware RNG, for instance). Given that there are no patterns in the plaintext, what implications are there for my choice of encryption algorithm? Could I get away with something as trivial as a Vigenere cipher (or XOR equivalent)? Assuming the keyspace is substantially large to prevent brute-force attacks, what other vulnerabilities are there when the plaintext is random?
|
|
Generally, no, but it depends somewhat on what you want to do with your random file. For example, let's say you want to send the random file to your friend for use as a one-time pad. Since you're worried that someone might be intercepting messages between you and your friend, you decide to encrypt the pad with a simple Vigenère cipher, like this: $$P'_i = (P_i + K_{i \,{\bmod}\, L}) \bmod N$$ where $P$ is the original one-time pad, $P'$ is the encrypted pad, $K$ is a key (of length $L$) known to you and your friend, and $N$ is the size of the alphabet. However, let's say that an adversary does intercept the encrypted pad $P'$ and saves a copy of it. When your friend uses the decrypted one-time pad $P$ to send you a message $M$ encrypted as $$M'_i = (M_i + P_i) \bmod N$$ the adversary intercepts that too, and uses the encrypted pad $P'$ they captured to decrypt it: $$\begin{aligned} M''_i &= (M'_i - P'_i) \bmod N \\ &= (M_i + P_i - P_i - K_{i \,{\bmod}\, L}) \bmod N \\ &= (M_i - K_{i \,{\bmod}\, L}) \bmod N \end{aligned}$$ Now they have a string $M''$ which is simply $M$ encrypted with the same simple Vigenère cipher that you used to encrypt $P$ into $P'$ (except that the key has been negated, but that's a minor detail), and they can use standard Vigenère cipher breaking techniques to try and recover $M$ fairly easily. |
|||
|