HackBlue

Tools · Cryptography and passwords in practice · 23 / 24

A ciphertext length is not the plaintext

The length of a ciphertext file is how many bytes that file contains. It is not the message, and it does not name an algorithm. Write the length as a size, and leave the method unclassified unless the file’s header says it.

9 min read · practice only with authorization

Length is a size

A ciphertext blob has a size you can measure. That size is a property of the file. It does not display the message that was encrypted, and it does not tell you who can read it.

A label on the filename, such as secret.blob, is a name you chose. It is not a mode and not a key.

The method is a different field

Some formats print a header that names how they were produced. If you did not read a header, write “method not in the file header.” Do not choose an algorithm because the length is a round number.

This note does not recover a message and does not choose parameters. The beginner step is to record what the file shows and stop.

What to write down

File the path, the length in bytes, and any header text you actually saw. If someone asks what the message says, the answer is that the ciphertext does not say it.

Lab: forty-eight bytes called a sentence

secret.blob is 48 bytes. There is no header text in the note. A draft says the plaintext is a 48-character sentence and names a mode because 48 is divisible by 16.

The note says the file is 48 bytes and the method was not in a header. The message is not a 48-character sentence in this record. The mode is not named.

Snippet
path: secret.blob
length: 48 bytes
header text: none recorded
write: size only
not: a 48-character sentence, and not a mode

Diagram

Record the size, then stop

  1. Path

    Which file you measured.

    File
    secret.blob
  2. Length

    How many bytes it contains.

    Size
    48
  3. Header

    Only if the file showed one.

    Gap
    none recorded
  4. Message

    Not in the length.

    Note
    do not invent it

Check yourself

1. secret.blob is 48 bytes and has no header in the note. What is 48?

2. Why not name a mode from a length that is divisible by 16?

3. Someone asks what the message says. What do you answer from this file alone?