News for hackers. Stuff that matters.
Re:Don't pass on small block ciphers by avidiax on Tuesday February 17, 2026 @02:25PM (#47051865)
If you want to encrypt a serial number, you don't want the output to be 256 bits.
Re:Don't pass on small block ciphers by adrian_b on Tuesday February 17, 2026 @04:34PM (#47053709)
The size of encrypted data is completely independent of the block size of a block cipher function that is used for data encryption.

Nowadays, there is almost never any reason to use for encryption any other modes of operation except CTR or OCB, which do not expand the size of encrypted data.

That said, the parent article was less about encryption and more about random number generation, which is done by encrypting a counter value, but you never need to decrypt it again.

In RNGs, the block size again does not matter, as the output can be truncated to any desired size.

Re:Don't pass on small block ciphers by avidiax on Thursday February 19, 2026 @11:59AM (#47075978)
The problem domain is that you want to separately encrypt/decrypt various 32-bit serial numbers.

CTR mode turns this into just an XOR operation. That provides very little security. Anyone observing sequential sequence numbers (particularly rollovers) will quickly derive the partial value of the first CTR mode cipher block.

A 32-bit cipher, on the other hand, essentially creates a permutation of the entire 32-bit space that's reversible with the key. Ideally, the encrypted value of serial #1 tells you nothing about the value of serial #2, which is the case for practical 32-bit ciphers.

Re:Don't pass on small block ciphers by SAI_Peregrinus on Tuesday February 17, 2026 @04:44PM (#47053840)
AES is most often used in a streaming mode, where it's used to generate a keystream. AES alone is useless, it MUST have a mode of operation to provide any security. A streaming mode can then encrypt any number of bits greater than 0. AES-CTR is one of the more common streaming modes.