Why it exists
A brake controller receives a plausible command. A vehicle downloads a software package. A backend receives diagnostic data. In each case, the bytes alone do not establish who supplied them, whether someone changed them or whether they belong to an earlier exchange.
Cryptography provides tools to answer these questions even when an attacker can observe or modify communications. It also protects confidential data from readers who lack the right key.
The engineering task starts with the protection goal. A public software image may need an authentic signature without needing secrecy. A private diagnostic session may need both. Choosing “encryption” before identifying the goal can leave the actual threat untreated.
What it is
Cryptography uses mathematical algorithms and, for many operations, keys to protect information. Its main goals are:
- Confidentiality: keep information unreadable to unauthorized parties.
- Integrity: detect unauthorized changes to protected information.
- Authenticity: establish that information comes from a party holding an expected credential.
- Non-repudiation: provide evidence attributable to a signer that others can verify. This depends on identity binding, key custody and supporting records; a signature alone does not settle a dispute.
- Freshness: establish that information belongs to an acceptable current exchange or sequence, rather than being an old valid message replayed by an attacker.
These goals overlap, but they are not interchangeable. An authentic message can still be stale. Confidential data can still be altered if its encryption scheme does not also protect integrity.
Kerckhoffs’s principle says that security should survive disclosure of the system’s design. Algorithms can be public; keys must remain secret where the scheme requires secrecy. A proprietary algorithm hidden inside firmware is no substitute for a reviewed design.
Encryption keeps the content secret as long as K stays secret. It does not prove who sent the message; that needs a MAC or signature (see Hashes and MACs).
How it works
The building blocks have different jobs. A protocol combines them with rules about message formats, identities, keys and failure handling.
| Building block | Beginner explanation |
|---|---|
| Hash | Produces a fixed-size fingerprint of data. A cryptographic hash makes finding matching fingerprints for deliberately different inputs difficult. It uses no secret key. |
| Message authentication code (MAC) | Produces a verification tag using a shared secret key. It detects changes and establishes that a key holder produced the tag. |
| Symmetric encryption | Uses a shared secret key to turn readable data into ciphertext and recover it. Prefer authenticated encryption when confidentiality and integrity are both required. |
| Digital signature | Uses a private key to sign data and a corresponding public key to verify it. Verification does not require sharing the signing secret. |
| Key agreement | Lets participants derive a shared secret over a communication channel. Authentication is needed to establish whose secret they share. |
| Random numbers | Supply unpredictable material for keys and other protocol inputs. Cryptographic randomness requires a suitable generator and entropy source. |
Shared keys and key pairs
Symmetric cryptography is like giving trusted colleagues copies of the same safe key. Each copy can open the safe. With a MAC, each key holder can also create valid tags. A receiver therefore cannot use a shared-key MAC to prove to an independent observer which holder sent a message.
Asymmetric cryptography uses a related private and public key pair. For signatures, imagine a signing stamp kept in a locked drawer and a public verification tool that recognizes its impressions. The public tool can check signatures but cannot create them. This is an analogy: signatures operate on data, and the private key must remain protected.
A public key also needs a trustworthy connection to an identity or role. A mathematically valid signature from an attacker’s key is still an attacker’s signature. Certificates or provisioned trust anchors establish which keys a vehicle accepts.
Protocols often combine both approaches. Transport Layer Security (TLS), specified in RFC 8446, can authenticate a server and establish shared session secrets, then protect application traffic with symmetric authenticated encryption.
Matching tools to goals
| Goal | Building block or mechanism | Vehicle example |
|---|---|---|
| Confidentiality | Symmetric authenticated encryption with established session keys | TLS protects diagnostic or account data between vehicle and backend. |
| Integrity | Digital signature over an image or authenticated manifest containing its hash | Secure boot rejects software whose verified contents do not match the authorized release. |
| Authenticity | MAC with a provisioned shared key | Secure Onboard Communication (SecOC) checks protected onboard messages. |
| Non-repudiation | Digital signature plus identity binding, protected signing keys and retained evidence | A signed over-the-air (OTA) release manifest supports attribution to a release authority. |
| Freshness | Authenticated counter, timestamp or challenge, checked against receiver state | SecOC rejects replays; vehicle-to-everything (V2X) receivers apply message-age checks alongside signature verification. |
A hash alone does not authenticate a download: an attacker able to replace the file may also replace an unprotected hash. Likewise, a signature does not automatically prevent installation of an old, correctly signed release. OTA needs a separate rollback policy.
Security strength is not key length
Security strength in bits describes estimated attack effort, rather than simply counting key bits. NIST SP 800-57 Part 1 Revision 5, Table 2, gives approximately 128-bit security for the Advanced Encryption Standard with a 128-bit key (AES-128), elliptic-curve cryptography (ECC) using P-256, and RSA with a 3072-bit modulus (RSA-3072), under conventional attack assumptions.
Those examples are not equivalent in speed, storage or purpose. They also do not describe resistance to a sufficiently capable quantum computer. Protocol mistakes, exposed keys or implementation flaws can undermine any nominal strength.
When to use it — and when not
Use cryptography where data crosses a trust boundary: onboard networks, software installation, backend connections, service access or external communications. Select the required goals from the threat analysis, then use an established protocol and approved implementation.
Do not expect cryptography to establish that a physical measurement is true. A compromised sensor with a valid key can authenticate false data. It also cannot stop bus jamming or guarantee that a verified command is safe. Plausibility checks, access control, availability measures and safety mechanisms still have their own jobs.
Best practices
- Never invent your own crypto. Use reviewed protocols, maintained libraries and approved algorithm profiles.
- Define key ownership, provisioning, storage, replacement and revocation before integration.
- Authenticate context as well as payload: message purpose, sender role and relevant version or sequence information.
- Follow each scheme’s rules for nonces: values used for individual operations. Some require uniqueness, some unpredictability; random generation does not automatically satisfy every requirement.
- Test verification failures, resets, lost synchronization and interrupted updates. Define recovery without silently disabling protection.
- Plan algorithm and trust-anchor changes over the vehicle’s service life.
Common pitfalls
- Treating encryption as proof of authenticity, or a checksum as protection against deliberate modification.
- Accepting a valid signature without checking whether its key is authorized for that action.
- Reusing a nonce where the encryption scheme requires uniqueness.
- Accepting old valid messages because freshness state was lost after reset.
- Sharing a fleet-wide secret without assessing how one compromised device affects others.
- Acting on protected data before verification succeeds, or logging keys while investigating failures.