2
$\begingroup$

is there a way to specify the encrypted message length when using private and public keys? mainly I want the encrypted message to be 32 bytes? as I'm currently using RSA but that results in a length that is equal to the modulus Length.

$\endgroup$
1
  • $\begingroup$ Do you want your ciphertext size equal to plaintext size in public key cryptography? $\endgroup$
    – kelalaka
    Nov 27, 2018 at 11:05

1 Answer 1

1
$\begingroup$

Asymmetric cryptography are never space-efficient.

For example, in multivariate cryptography the public key is often the expanded matrix of coefficients of indeterminates, where as the private key are decomposed transformations allowing efficient decryption/signing. Although you can get ciphertext/signature size not too different from plaintext/hash size in multivariate schemes, the public key size is almost always huge.

The reason I bring up multivariate cryptography is 1) it's secure against quantum computers (as far as we know). 2) it's space efficient with ciphertext and plaintext as you've requested (but not with key sizes). and 3) it's a good illustrative comparison with symmetric-key cryptography.

Remember XSL attack? It fails catastrophically because accumulated rounds of AES permutations expands to high-degree multivariate expression of its inputs.

To summarize: You can specify ciphertext size with multivariate cryptography if you have the right scheme. But you loose the ability to specify public-key size there.

You can keep an eye on NIST PQC standardization, where there are some multivariate contenders. But keep in mind, that these schemes are in their earily stages of development.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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