1
$\begingroup$

I would like to know if there is any encryption algorithm with variable input variable output with out any padding? For example if I give 16(17,18,67,117,..any size) bit plaintext, my ciphertext is also 16(17,18,67,117,..any size) bits.

$\endgroup$
  • 1
    $\begingroup$ Look for format preserving encryption. But if you can afford it, you should use an IV and a MAC, even if they cost a couple of bytes. $\endgroup$ – CodesInChaos Sep 8 '15 at 12:08
  • 1
    $\begingroup$ stream ciphers? $\endgroup$ – Richie Frame Sep 8 '15 at 12:21
1
$\begingroup$

It is important to understand that secure encryption - by the standard notion of security - must be probabilistic. This is so that the same value encrypted twice will look completely different. Otherwise, it is possible to compute statistics and learn a lot of information. The easy fact based on this is that secure encryption must increase the size (the ciphertext has to be bigger than the plaintext).

It is possible to also assume state. For example, if the encryptor and decryptor can keep track of a unique nonce (e.g., a counter), then it is possible to still get secure encryption. (For example, use CTR mode.)

If you don't have either of these, then you are in trouble. This doesn't mean that you can't do anything reasonable, but we don't have enough information about your application to help. Just encrypting using format-preserving encryption can be very problematic, depending on what you want to do. I refer to a recent paper by Seny Kamara and others that will appear at ACM CCS 2015 that presents attacks on databases encrypted using deterministic encryption.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.