What type of encryption can be used for 48-bit to 48-bit?

I have a bunch of 48-bit (6 bytes) values ​​that I need to encrypt symmetrically. These two requirements:

  • As a result, the encrypted value should also be 48 bits (6 bytes) long. They themselves can be (and will be preferable) much longer to defend brute force attacks again.

  • The resulting encrypted value must be deterministic, that is, the value A using the key B will always produce the encrypted value C (we encrypt it on the fly and show the encrypted data to the user, so we should always show the same value)

All the block ciphers that I found used the minimum block size of 64 and seem to be fixed (you cannot use an arbitrary block size). Should I think of a stream cipher?

I am doing this in Java.

Note: I saw this question and the answers associated with it, but it was not clear whether the proposals would satisfy my second requirement.

+3
source share
6 answers

(Sorry, I initially misunderstood the requirements, considering it to be INPUT data, which should be 6 bytes.)

I do not think that you can do exactly what you want with standard cryptographic algorithms:

  • , , , XORing ; , (, , XORing , XORing , 48 2 48 , );
  • , , , 48 .

, 48- - - , , - , , .

:

  • 48- ; , TripleDES 64- "" ( 112- ) [*];
  • , , , , . Feistel, - , . Schneier, "Applied Cryptography", . 346ff, " ".

, whist , , ; .

(, , , ), , -, , ( - , , , , ). , Feistel , , .

[*] TripleDES , AES ( , Java, , ). .

, "" , ( , ), . ( padding mode, .)

+3
+6

, ,
http://web.cs.ucdavis.edu/~rogaway/papers/shuffle.html
PRP (, ) PRF (, sha256, blake2)

CTR , .
MAC ( ) .
IV ( ) .

+2

, ( , ).

(, , ), , . RC4-drop.

, , , , 48 ( .)

48 - , . , , 48- 192- , 64- , 48- . ( , ?)

+1

/, , - CTR ().

V, N K:

  • N ;
  • N K;
  • 48 XOR V.

- . , :

.

. , .

+1

There is a 48-bit block 80-bit cipher key developed in 2009 - KATAN48 (the family version of KTANTAN48 has some key schedule problems. So far it has not been violated and has pretty high security limits, so it has passed the time test.

0
source

Source: https://habr.com/ru/post/1762902/


All Articles