Java – what type of encryption does 48 bit to 48 bit use?

I have a stack of 48 bit (6-byte) values and I need symmetric encryption These two requirements are:

>The generated encrypted value also needs 48 bits (6 bytes) long They themselves can (and preferably) take longer to prevent violent attacks. > The generated encrypted value needs to be deterministic, that is, using the value a of key B will always generate the encrypted value C (we encrypt and display the encrypted data to the user during operation, so we need to always display the same value)

All block ciphers I found use the smallest block size of 64 and look fixed (no arbitrary block size can be used) Should I consider streaming passwords?

I do this in Java

Note: I've read this question and related answers, but I'm not sure whether these suggestions meet my second requirement

Solution

(sorry, I misread the request for 6 bytes of input data at first.)

I don't think you can use standard encryption algorithms to do exactly what you want:

>The problem of stream cipher is that the standard cipher works effectively by generating pseudo-random bit streams from the key and XOR these bits with plaintext; In fact, this means that you should never use the same bit stream twice (for example, if you do so, the XORing two ciphertexts will give you the same result as the corresponding plaintext; and in any case, there are 48 bits, and only 2 ^ 48 possible bit streams, so you can test them through brute force; > the problem with block ciphers is that as far as I know, there is no standard cipher when the block size is 48 bits

Now, that doesn't mean you can't develop 48 bit block ciphers - in fact, I dare say there are some passwords - but the swamp standard password encryption community that hasn't been reviewed for many years has that block size

So my suggested options are:

>Relax the requirements of 48 bit ciphertext; For example, tripledes has a 64 bit block size and "equivalent" security (equivalent to 112 bit security) [*]; > In principle, you can use any block size you need to implement your own block cipher as close to the standard design as possible. For example, Feistel network following some commonly recommended design principles - as a starting point, see Schneier, "applied cryptography", pp. 446ff, "block cipher design theory"

The obvious problem with the latter option is that whist standard block ciphers are usually based on common general principles, and they adopt specific design decisions that have been subject to considerable scrutiny; You probably won't

I also suggest taking a step back from the problem (or perhaps explaining what you're trying to do) because it seems to be based on requirements that usually violate good security practices (always encrypt with the same plaintext) for example, for the same ciphertext, such ciphertext is usually specifically avoided So you can have the best designed Feistel password in the world, but you will introduce some other vulnerabilities in how you use it

[*] tripledes is generally not recommended because AES can provide better security more effectively (you may want to see some comparative timing of block ciphers I use in Java to see how bad it is) However, this may not be relevant to your particular application

No, just "fill" your data with some bytes you don't care about (but it's always the same if this is your requirement), so you can reach the size of a block (if you are using the appropriate padding mode, this will be done for you.)

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>