Using an encryption algorithm like AES, is it possible to generate a fixed length cipher text no matter how long the plain text becomes?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
That is quite impossible. Lets assume that such an encryption scheme would exist and assume that it always outputs ciphertexts of length $n$ bits.
Then, because the scheme is assumed to encrypt plaintexts of arbitrary length, it in particular encrypts all plaintexts of length $n+1$ to ciphertexts of length $n$. However, there exist twice as many plaintexts of length $n+1$ than ciphertexts of length $n$. So by the pigeonhole principle there exists at least one ciphertexts that encrypts more than one plaintext. This directly implies, that decryption would be impossible in such a scheme.
If you agree to define "fixed length cipher text" in such way that the import criterion isn't that the cipher text has a constant bounded length, but that the length of the cipher text is independent of the length of the plain text, the trick is simply to ensure that the cipher text is at least not shorter than the total amount of plain text.
In practice, this end is typically achieved by encrypting the medium instead of encrypting the contents. If you want to protect the confidentiality of files you store on a hard drive - encrypt the entire hard drive, instead of the individual files; if you want to protect the confidentiality of data you send over a transport - send a continuous stream of cipher text over the transport.