# How to encrypt a short plain text?

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?

• Format preserving encryption. – CodesInChaos Feb 25 '18 at 10:36

• @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? – Squeamish Ossifrage Feb 26 '18 at 3:44