Authentication & Access · Study deck

Authentication Methods for IoT

Carry the chapter's decisions forward in order.

Shield Shelly is your guide for this deck.

authenticationpasswordssalted-hashing
Shield Shelly, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: JWT Structure and Algorithm Pitfalls A JWT has three base64url parts joined by dots: a header naming the algorithm and type, a payload of claims, and a signature over the header and payload.
  • Explain: The device must hold three things: the CA certificate it trusts, its own device certificate, and its private key — which belongs in a secure element so it cannot be extracted.
  • Explain: A salt is a unique random value per user that is mixed into the hash, so identical passwords produce different stored hashes and precomputed rainbow tables become useless.
iotclass.org

Major section

Start With Who Is Signing In

Reusing one login pattern for both can turn one stolen secret into a fleet-wide failure.

  • Multi-factor authentication means requiring independent kinds of proof from a person.
  • An API means a named software entry point used by another program.
  • A gateway is the device or service that joins two system paths.

Key terms

Passwords
Passwords are the simplest and the most attacked.
Certificates with mutual TLS
Certificates with mutual TLS are the gold standard for unattended devices, giving each unit a unique cryptographic identity.
iotclass.org

Major section

Start With Who Is Signing In (continued)

TLS means protected transport that checks the service identity and can also check the client.

  • A connected device is not yet a trusted device.
  • This runway does not make one method best for every actor.
  • The engineering question is which proof fits that actor and threat.
  • Passwords are the simplest and the most attacked.
iotclass.org

Major section

Start With Who Is Signing In (continued)

Certificates with mutual TLS are the gold standard for unattended devices, giving each unit a unique cryptographic identity.

  • Tokens such as JWT carry the result of a prior authentication so an API does not re-check a password on every call.
  • The Core Idea Certificates for devices Unattended devices cannot type passwords or codes.
  • A reviewer needs to know it is a salted, deliberately slow hash, not a single fast digest.
iotclass.org

Major section

Build the Method Around Risk

Selecting an authentication method is a risk decision, not just a technical one.

  • A low-severity flaw on an internet-facing controller can outrank a high-severity flaw on an isolated bench device.
  • The output is a method matched to the asset's real exposure.
  • Higher; needs a CA, issuance, and revocation.
JWT authentication flow: a client logs in to an auth server, receives a signed JWT, then sends API requests with the JWT in the header; the API server verifies the token signature and responds. The JWT has a header, payload, and signature.
JWT authentication flow: a client logs in to an auth server, receives a signed JWT, then sends API requests with the JWT in the header; the API server verifies the token signature and responds. The JWT has a header, payload, and signature.
iotclass.org

Major section

Build the Method Around Risk (continued)

Immune; there is no reusable shared secret.

  • Constrained devices need room for a key in secure hardware.
  • The header names the signing method, the payload carries readable claims, and the signature detects alteration.
  • Critically, a JWT payload is not encrypted: it is base64url-encoded and fully readable, with the signature providing tamper-evidence, not confidentiality.
iotclass.org

Major section

Under the Hood: What Each Method Proves

Current guidance (OWASP, RFC 9106) favors Argon2id, a memory-hard function; bcrypt, scrypt, and PBKDF2 with a high iteration count are acceptable alternatives.

  • The deeper layer explains how each method actually authenticates and why each fails in a specific way.
  • The result is a mutually authenticated, encrypted channel.
  • The token is authentic and still valid.

Key terms

Credential stuffing
Credential stuffing is not guessing; it replays username and password pairs leaked from other breaches, betting that some users reuse them.

Why it matters

This signature is the heart of the proof: merely presenting a certificate proves nothing, because certificates are public.

iotclass.org

Major section

Under the Hood: What Each Method Proves (continued)

A salt is a unique random value per user that is mixed into the hash, so identical passwords produce different stored hashes and precomputed rainbow tables become useless.

  • Typical Argon2id parameters might be a few iterations over tens of megabytes of memory with modest parallelism, tuned so a single verification takes a fraction of a second.
  • The verifier must decide the algorithm, not the token.
  • The client truly holds its certificate's private key.
iotclass.org

Major section

Under the Hood: What Each Method Proves (continued)

Because verification only needs the signing key, a server can validate a token without storing session state — the convenience of statelessness.

  • An optional pepper — a secret kept separately from the database — adds defense if the hash store alone is stolen.
  • The client then presents its device certificate and proves it holds the matching private key by signing a value in the handshake (the CertificateVerify step).
  • Accepting a presented cert without the signature enables forgery.
iotclass.org

Major section

Under the Hood: What Each Method Proves (continued)

A password alone offers no defense against an attacker who already holds a valid pair.

  • The device must hold three things: the CA certificate it trusts, its own device certificate, and its private key — which belongs in a secure element so it cannot be extracted.
  • JWT Structure and Algorithm Pitfalls A JWT has three base64url parts joined by dots: a header naming the algorithm and type, a payload of claims, and a signature over the header and payload.
  • A trustworthy review names the method, its evidence, and the specific way it would break.
iotclass.org

Deck summary

Key takeaways

Reusing one login pattern for both can turn one stolen secret into a fleet-wide failure.

  • TLS means protected transport that checks the service identity and can also check the client.
  • Certificates with mutual TLS are the gold standard for unattended devices, giving each unit a unique cryptographic identity.
  • Selecting an authentication method is a risk decision, not just a technical one.
  • Immune; there is no reusable shared secret.
iotclass.org

Retrieval practice

Recall check 1 of 3

Shield Shelly says: answer from memory, then check your reasoning.

Q1You must authenticate ten thousand headless field sensors to a cloud service, with no human present at any device. Which method fits best?

APer-device X.509 certificates with mutual TLS
BA single shared password configured on every sensor for simplicity
CTime-based one-time codes that each sensor enters at login
DSMS one-time passwords sent to each device
Show answer

Answer: A Certificates give each device its own identity and support mutual TLS and per-device revocation, which suits large unattended fleets.

iotclass.org

Retrieval practice

Recall check 2 of 3

Shield Shelly says: answer from memory, then check your reasoning.

Q2A developer proposes embedding each device's long-lived API secret inside the JWT payload so the backend can read it on every request. Why is this unsafe?

AIt is safe, because the signature encrypts the payload so only the server can read it
BIt is safe as long as the token uses HS256 rather than RS256
CA JWT payload is only base64url-encoded, not encrypted, so anyone who sees the token can read the secret.
DIt is unsafe only because the token would be slightly larger
Show answer

Answer: C Tokens are readable by design.

iotclass.org

Retrieval practice

Recall check 3 of 3

Shield Shelly says: answer from memory, then check your reasoning.

Q3During a mutual-TLS handshake, what specifically proves that the client legitimately owns the certificate it presented?

ASimply presenting the certificate is enough, because only the owner could have a copy of it
BThe server decrypts the certificate with the CA's private key to confirm ownership
CThe certificate's validity dates prove the client owns the private key
DThe client signs a handshake value with its private key (CertificateVerify).
Show answer

Answer: D Certificates are public, so presenting one proves nothing.

iotclass.org

Print reference

Answers

Answer key.

  1. A · Certificates give each device its own identity and support mutual TLS and per-device revocation, which suits large unattended fleets.
  2. C · Tokens are readable by design.
  3. D · Certificates are public, so presenting one proves nothing.
iotclass.org