1
$\begingroup$

I want to encrypt a short plain text (i.e., 30bit), and the requirement is that length of cipher text is the same as the short plain text.

It seems that stream encryption methods like CFB-8 satisfies my requirement. My question is that

  1. What is the cracking time of CFB-8 in brute-force-attack? Does the cracking time only depend on the key length?

  2. Does the length of plain text influence the cracking time? if so, what's the relationship?

  3. Are there any better methods for my requirement?

$\endgroup$
  • 5
    $\begingroup$ Format preserving encryption. $\endgroup$ – CodesInChaos Feb 25 '18 at 10:36
1
$\begingroup$

Do you need to reuse the key for multiple messages without any way to distinguish the role of each message, e.g. by a message sequence number, or file position for a collection of records in a single file?

If you have some short identifier that is never reused between each role, or if you need encrypt only a single message with each key, then you can pick your favorite stream cipher, say ChaCha or AES-CTR, with the message role (sequence number, file position, etc.) as the nonce, and just chop the first 30 bits off the stream.

If you must reuse the key for many messages with no way to distinguish the role of each message, then you need format-preserving encryption.

$\endgroup$
  • $\begingroup$ Thanks. It looks that both stream cipher and format preserving encryption all satisfy my requirement. My further question is how about the security of these methods if length of the message is fixed 30bit, or 50bit? $\endgroup$ – Jun Fang Feb 26 '18 at 1:53
  • $\begingroup$ @JunFang The length of the message is not important except insofar as you can't force the attacker to have worse probability of success than $2^{-30}$ at guessing the entire message in one try even if you pick your messages uniformly at random. But more importantly, you should consider what your threat model and desired security properties really are. You didn't mention anything about authentication, but that's usually even more critical than confidentiality. Can the adversary only eavesdrop on messages, or is there any chance they also attempt to modify the messages in transit? $\endgroup$ – Squeamish Ossifrage Feb 26 '18 at 3:44
  • $\begingroup$ Stream cipher CTR can achieve our goal. Thanks for your suggestion. $\endgroup$ – Jun Fang Feb 28 '18 at 1:23

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.