✳ The reference desk / In practice

Digital signature

A value made with a private key over some data. Anyone holding the matching public key can check it to confirm the data is unchanged and which key signed it.

What it means

A digital signature uses a key pair. The signer keeps the private key and uses it to produce a signature over a message. Anyone with the matching public key can verify it. If a single byte of the message changes, verification fails. Only one party holds the private key. So a valid signature is also evidence of which key signed. A shared-key check such as an HMAC cannot give that to a third party.

Three things are outside it. A signature does not hide the message. It does not say whose key it is, which takes a trusted certificate or a key you pinned in advance. And it does not grant permission or show what a person intended. Use an established algorithm exactly as specified, such as Ed25519, ECDSA or RSA-PSS.

See the idea / Data

A signature shows which key signed and that nothing changed.

The control room signs one command and the relay verifies it. Then one character changes on the way and the check fails.

Synthetic command: HALCYON M-0412 BURN 4.2 S. The control room holds an Ed25519 private key inside an HSM, a device that uses a key and will not export it. Ed25519 is one signature algorithm. The relay station already holds the matching public key, pinned in its configuration, which means set there in advance. That key begins 7851e3bc. The command is not secret in this example.

Digital signature: The control room signs one command and the relay verifies it. Then one character changes on the way and the check fails. The chapter text below describes every state.Control room → relay stationCommand M-0412 · Ed25519 signatureControl room · private keyCommand ready · unsignedKey stays inside the HSMIn transit · readableNothing sent yetSigning does not encryptRelay · pinned public keyWaitingKey 7851e3bc… set in advanceVerification at the relayNot runPermission is checked elsewhereSIGNING THE COMMAND BYTES

01 / 04

Sign

The control room signs the exact bytes of the command with its private key. The result is a 64-byte signature.

More about this step

The command is the 25 ASCII characters HALCYON M-0412 BURN 4.2 S. Ed25519 produces a 64-byte signature, shown here by its first four bytes, f207d3ea. Signing happens inside the HSM, so the private key never appears on the console. Signing is its own operation with its own rules. It is not encryption with the private key.

Keep in mindThe command and the key pair are synthetic, and the key is for teaching only. A valid signature ties bytes to a key. Tying the key to the control room needs the pinned key or a validated certificate. A signature does not hide the command, grant permission, stop a replay of an old command, or prove what a person intended.

Read the visual, step by step

Bytes arrive unchanged

  1. Sign. The control room signs the exact bytes of the command with its private key. The result is a 64-byte signature. The command is the 25 ASCII characters HALCYON M-0412 BURN 4.2 S. Ed25519 produces a 64-byte signature, shown here by its first four bytes, f207d3ea. Signing happens inside the HSM, so the private key never appears on the console. Signing is its own operation with its own rules. It is not encryption with the private key.
  2. Send. The command and its signature travel to the relay. Anyone on the path can read both. A signature does not hide anything. If the burn time had to stay secret, the control room would sign the command and then encrypt the signed result for the relay.
  3. Choose key. The relay takes the public key from its own configuration. It does not trust a key that arrives with the message. Verification ties bytes to a key. It says nothing about whose key it is. The relay knows this key belongs to the control room because it was pinned in advance. A validated certificate is the other common way to tie a key to a name. The pinned key begins 7851e3bc.
  4. Verify. The relay runs verification over the bytes it received. The signature fits, so the command is what that key signed. A valid result means the bytes are unchanged and were signed with the private key that matches the pinned public key. The relay still checks separately that this signer may send this command and that it is not a replay of an old one.

One character changed

  1. Sign. The control room signs the exact bytes of the command with its private key. The result is a 64-byte signature. The command is the 25 ASCII characters HALCYON M-0412 BURN 4.2 S. Ed25519 produces a 64-byte signature, shown here by its first four bytes, f207d3ea. Signing happens inside the HSM, so the private key never appears on the console. Signing is its own operation with its own rules. It is not encryption with the private key.
  2. Send. On the way, one character changes: 4.2 becomes 9.2. The signature travels with the command, unchanged. The bytes that arrive are HALCYON M-0412 BURN 9.2 S. The change could be an attack or a fault. The relay cannot tell which, and it does not need to. The signature was made over different bytes.
  3. Choose key. The relay takes the public key from its own configuration. It does not trust a key that arrives with the message. Verification ties bytes to a key. It says nothing about whose key it is. The relay knows this key belongs to the control room because it was pinned in advance. A validated certificate is the other common way to tie a key to a name. The pinned key begins 7851e3bc.
  4. Verify. The relay runs verification over the bytes it received. The signature does not fit the changed bytes, so the relay rejects the command. One changed character is enough. The relay does not learn what the original said, only that these bytes are not what the key signed. It does not act on the command.

The command and the key pair are synthetic, and the key is for teaching only. A valid signature ties bytes to a key. Tying the key to the control room needs the pinned key or a validated certificate. A signature does not hide the command, grant permission, stop a replay of an old command, or prove what a person intended.

Flow references: RFC 8032: Edwards-Curve Digital Signature Algorithm · NIST FIPS 186-5: Digital Signature Standard

AN ILLUSTRATIVE SCENARIO

A software company and its updates

A company that makes point-of-sale software signs each update, and the tills verify the signature before installing. The signing key sits on a build server that every developer can log in to. A reviewer points out that anyone with that access could sign anything, and every till would accept it. The company moves the key into a hardware module that signs on request and keeps a log, and limits who can ask it to sign a release.

Put it to work

  1. Decide exactly which bytes are signed, and verify those same bytes before anything acts on them.
  2. Keep the private key where it cannot be copied, such as a hardware security module, and log every use.
  3. Give verifiers the public key by a route you trust: a pinned key or a certificate they validate.

How to check your work

Verify a signed file, then change one byte and confirm verification fails. Then verify with a different public key and confirm that fails too. Check that the system refuses unsigned input.

Connect the ideas

  • Hashing

    A one-way fingerprint of data used to detect change or store verifiers, not a reversible way to hide records you must later read.

  • Non-repudiation

    Evidence supporting a claim that a particular party originated or approved something, so a later denial can be evaluated. Reliable identity binding and record integrity matter.

  • Certificate

    A signed document that binds a public key to a name, such as a server hostname, and states who issued it and for how long it is valid.

  • PKI

    The set of roles, rules and systems that issue, check and revoke certificates, so that a public key can be tied to a name others will trust.

Explore a field lesson

Find your next idea.

Tip: press / to open search. Escape closes this window.