# Can a perfectly secret scheme have non-uniform ciphertext distribution if the plaintext and ciphertext length is equal?

I've seen this question asking if perfect secrecy implies uniform ciphertext distribution, and I understand that this is not the case. However, all given counterexamples seem to require a construction where the ciphertext length is larger than the plaintext length.

So I'm wondering if perfect secrecy, of a scheme with the additional requirement that the ciphertext must have the same length as the plaintext, would then imply a uniform ciphertext distribution.

• @Zabbulator: "can you prove this?"; yes (if we also assume the encryption is invertible; we can decrypt). If we denote the set of possible plaintexts as $P$ (where every plaintext has nonzero probability of occurring), the number of ciphertexts as $C$, and $|P| = |C|$. Then, for perfect secrecy to hold, the conditional probability of any output has to be independent of the plaintext (that is, $\forall c \in C, p_1, p_2 \in P: P(c | p_1) = P(c | p_2)$ and because for any key, any ciphertext output would correspond to a possible plaintext input, the ciphertext probabilities must be equal. Commented Apr 18 at 17:13
• Thanks for the proof. I do however not quite understand the last step ("because for any key, any ciphertext would correspond to a plaintext, the ciphertext probabilities must be equal."). I understand that fixing a key and a ciphertext will yield a uniquely determined corresponding plaintext, but not how this would affect any probabilities. What exactly contradicts $P(c_1|p) \neq P(c_2|p)$ for $p\in P, c_1,c_2\in C$ ? Commented Apr 20 at 13:46