Pre-Shared Key Authentication for IoT
What you'll learn: How IoT devices use pre-shared keys to authenticate securely with minimal overhead, including provisioning methods and when to use (or avoid) this approach.
What Is Pre-Shared Key (PSK) Authentication?
Pre-Shared Key authentication means both the IoT device and the server hold the same secret key before any communication begins. Think of it like having a copy of your friend's house key — you both know the key, so you don't need a locksmith (certificate authority) every time you visit.
When the device connects, both sides use the PSK to prove they know the secret without revealing it. This typically happens through cryptographic protocols like TLS-PSK or DTLS-PSK (for CoAP).
Key Provisioning Strategies
Getting PSKs onto devices is called provisioning:
- Factory provisioning: Keys injected during manufacturing. Secure but inflexible if keys need rotation.
- Out-of-band provisioning: Keys transferred via USB, QR code, or physical button press during setup.
- Bootstrap provisioning: Device uses a temporary master key to securely receive its unique PSK on first connection.
Each method balances convenience, security, and scalability.
Trade-offs: Security vs Simplicity
Advantages:
- Simple to implement with minimal code footprint (critical for constrained devices).
- No certificate infrastructure or public-key overhead.
- Fast authentication on resource-limited hardware.
Disadvantages:
- Key management nightmare: Every device-server pair needs unique keys for true security. Shared keys across devices = catastrophic if one is compromised.
- No forward secrecy by default (older sessions exposed if PSK leaks).
- Scalability issues: Managing thousands of unique PSKs becomes operationally complex.
Key Takeaway:
PSK authentication offers simplicity and efficiency for IoT devices with constrained resources, but requires careful per-device key provisioning and robust key lifecycle management to avoid becoming a single point of failure.