Remix.run Logo
avidiax 4 hours ago

If you want to encrypt a serial number, you don't want the output to be 256 bits.

adrian_b 2 hours ago | parent | next [-]

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.

SAI_Peregrinus 2 hours ago | parent | prev [-]

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.