2
$\begingroup$

Is this an issue for, perhaps, RSA? I wonder if a key could be any other size, say 261 bits.

$\endgroup$
2
  • $\begingroup$ RSA is not a symmetric cipher. $\endgroup$
    – user1686
    Mar 20, 2017 at 5:56
  • $\begingroup$ @grawity I wanted to know if symmetric keys could be of any size. I brought up RSA to see if it had to do with it. $\endgroup$ Mar 20, 2017 at 6:16

3 Answers 3

4
$\begingroup$

Modern CPUs are typically 64-bit. This gives us a very good performance incentive to design symmetric cryptography with block size as a multiple of this. There is a lesser (IMHO) drive for using $2^x$ bits, many parts especially in hardware will require ceil(log(length)) time/depth/gates by using $2^x$ we get more efficient implementations. Obviously we could build a less efficient (bytes/second or bytes/$) cipher with arbitrary block size.

$\endgroup$
2
  • $\begingroup$ What if it was a stream cypher? $\endgroup$ Mar 19, 2017 at 7:23
  • $\begingroup$ Stream ciphers have a key size and an internal state size as well, and these are also essentially always of size 2^x bits for the same reasons. $\endgroup$
    – Meir Maor
    Mar 19, 2017 at 7:27
1
$\begingroup$

There is a possible confusion here to be wary about. The key size is not necessarily related to the block size.

I. About the block size

Most of the case this is the case:

  • Rijndael has a block size of 128 bits ($2^7$) and key sizes such as 128 bits, 192 bits and 256 bits (respectively $2^7, 2^7 + 2^6, 2^8$).
  • idem for Twofish... and most of AES competitors.

However the era of block-cipher is coming to an end.

Imagine there's no block ciphers, it's easy if you try :-)
Joan Daemen - FSE 2017

By that it means that we are more likely to see permutations and sponge-based crypto than block-ciphers.

Examples:

  • Keyak has a state size of 1600 bits ($25 \times 64$)
  • NORX-64 has a state size of 1024 bits ($16 \times 64$)
  • Ketje has a state size of 400 bits ($25 \times 16$)
  • ASCON has a state size of 320 bits
  • Spongent has a state size of 384 bits
  • ...

We are further away for the traditional $2^x$ bloc size. What matters is that it is a multiple of 32 (or 64 bits for high-end CPUs) so we are more like having a state size of $y \times 2^x$ rather than $2^x$ or $2^x + 2^y$.

As for the hardware requirement... Keccak $\chi$ operation can be seen as a 5-bit S-box. But it is extremely efficient in hardware. The reason is that it can be seen via bit slicing and thus be encoded with very few gates.

II. About the key size.

We have shown that key size are not necessarily related to the block size. Most of the time the key size will be a multiple of $32$-bit (4 byte). This is due to the structure of the CPU and the format of the data when sent.

There are few exceptions. Obsolete DES (and TDES-EDE) key size is effectively 56 (112) bits but seen as 8 (16) bytes with a parity bit.

$\endgroup$
0
$\begingroup$

Yes. See for example Blowfish, which allows the key size to be any number of bits between 32 and 448.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.