Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
2 votes

How to handle padding when encrypting a value smaller than the block size

I want to encrypt numeric identifiers into ciphertexts that are deterministic and not too long. I am considering AES-128 in ECB mode to encrypt 64-bit integers. You are not considering ECB mode as ...
Maarten Bodewes's user avatar
  • 92.9k
1 vote
Accepted

What is the reason to use blocks in the first place?

Things are grouped into blocks for a variety of reasons: It keeps related thing together and in a fixed order within the block; like we bind the pages of a diary in volumes, say one page (thing) per ...
fgrieu's user avatar
  • 142k
1 vote

How to handle padding when encrypting a value smaller than the block size

Here is one possibility (using only a single blockcipher call) that would work and provide both confidentiality and integrity under the following conditions: The inputs are of fixed-size: 64 bits An ...
Marc Ilunga's user avatar
  • 3,258

Only top scored, non community-wiki answers of a minimum length are eligible