Re: Minimal length of encrypted data - which algorithm?

SST <lkozlowski_CUT_IT@xxxxxx> wrote:
I think it's a simplem question, but I cannot find in any description of
any algorithm information about the minimal length of encrypted data.
I am interested in obtaining such an information for symmetric-key
algorithms, like DES.
Is there any algorithm which ensures that the output will be at least
i.e. 32 characters (bytes) long - no metter whether the input is long
(i.e. 20 characters) or short (i.e. 1 character)?

If you only require a minimal ciphertext length, not maximal, then you can
use any reasonable scheme to encrypt a message padded with a sufficient
number of zeros.

If you want ciphertexts of _exactly_ 32 bytes, then you can construct
reasonable schemes: Let the first byte contain the number n of bytes
in the message, insert randomness into the first 32-n-1 bytes and use
AES in CBC mode without IV to encrypt. The maximal safe message length
depends on the number of messages you want to encrypt.

Another alternative is to use a 256-bit block cipher (Rijndael, for
example) and pad the message with some randomness (the amount again
depends on the number of messages you want to encrypt).

Kristian Gjøsteen

Relevant Pages

  • Crypt algorithm producing minimum ciphertext?
    ... I need to encrypt some text, but I want to encrypt it using an ... algorithm that produces ciphertext of the same or near length, ... ASCII ciphertext is preferred, binary data would have to be url ... few levels above that could be perhaps okay. ...
  • Re: determining algorithm used
    ... >> Is there a way to determine what algorithm has been used to encrypt the ... ordinary like using only 26 different characters in five character ... do the later from any existing ciphertext of any N set. ...
  • Re: What is exponent?
    ... For simple description of RSA algorithm ... I also have the receiver's certificate (public key only). ... Use RSA to encrypt the session key ...
  • Re: Use my your own HashAlgorithm Class
    ... Rather than use the EncryptValue / DecryptValue methods (which RSACryptoServiceProvider doesn't support), ... the Encrypt and Decrypt methods. ... >> doesn't know about your new algorithm. ... But CAPI doesn't work with OIDs directly, ...
  • RE: Password encryption
    ... I'm not looking to encrypt a password. ... Because we usually don't need to use symmetric algorithm to ... we just store the hash of the ... Microsoft Online Community Support ...