In the algorithm for BPS Format Preserving Encryption
Is this tweak always the same length (64bit)?
Why did they choose the length 64bit for the tweak?
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It only takes a minute to sign up.
Sign up to join this communityIn the algorithm for BPS Format Preserving Encryption
Is this tweak always the same length (64bit)?
Why did they choose the length 64bit for the tweak?
From the paper:
We denote by $f$ the number of output bits of the internal function $F$
and
We first divide the 64-bit tweak $T$ into two 32-bit sub-tweaks $T_L$ and $T_R$
plus
We denote by $L_i$ (resp. $R_i$) the left (resp. right) branch value after application of round $i$.
with the note
Note that because of our restriction on the number of input $s$-integers, we always ensure that each branch can be coded on a $(f − 32)$-bit word.
Right, so now look at part of the definition of the cipher:
...
$L_{i+1} = L_i \boxplus F_K ((T_R \oplus i) \times 2^{f −32} + R_i) \mod s^l;$
...
although multiplication is represented by a dot instead of $\times$. Similarly for the calculation of the state $R_{i+1}$ of course.
Basically, this shifts the tweak to the most significant 32 bits, leaving the rest for the state. Now $F$ can be AES, HMAC-SHA-2 or TDES. TDES has a block size of 64 bit. If the tweak size was 128 bit then there would not be any space left for $R$ or $L$ that make up the internal state.
So the tweak size is such that repetition of the tweak is unlikely and it can still be used efficiently when the encryption uses a 64 bit block cipher. If the tweak would be larger the construction would become less efficient, up to the point that the scheme would not work at all.