views:

62

answers:

2

I don't know too much about encryption, I just want to ask, which method can get me the shortest result message ?

For instance, the message looks like this : "This is the secret input message", I wonder if the encrypted message can be shorter then the above 32 characters long ? Maybe something like "dfkfjkvf12".

Frank

+1  A: 

It is mathematically impossible for the ciphertext to be shorter than the plaintext.

In general, longer ciphertexts mean securer cipers.

SLaks
To expand and combine SLaks' two statements: if you're looking to reduce the payload size of your text, as well as encrypting it, you'll want to do two separate actions: compress your plaintext (zip or gzip are obvious choices) and encrypt the result.
Michael Petrotta
Nitpick: for block ciphers, longer keys mean more security, there's not really a relation between ciphertext length and security. The point stands about _reduction_ of length, though.
Marc Bollinger
It depends. If you want "ciphertext indistinguishability" then you have to randomize your ciphertext (i.e. use an IV). If you want security against chosen ciphertext attacks then you may need to protect your ciphertext with a MAC. Hence securing your data well, means adding extra bytes to your ciphertexts.
abc
+2  A: 

If you want the output to be shorter than the input, you're not really talking about encryption. What you're talking about is compression or, more likely, hashing. If you just want a secure way to compare a known text with a ciphertext (such as for password exchange, for example), then there are any number of hashing schemes you can use, the most well-known of which is probably MD5.

JSBangs
Use SHA2, not MD5.
SLaks