Hardware Security Modules (HSMs) are tamper-resistant physical devices that generate and store cryptographic keys. In cellular networks, they protect subscriber keys, so that somebody who steals the database can’t decrypt them and clone SIM cards. Operators can also use an HSM to protect SMS messages.

Here's my YubiHSM 2, one of the more affordable HSMs on the market:

The YubiHSM 2 Hardware Security Module (HSM) from Yubico
The YubiHSM 2 Hardware Security Module (HSM) from Yubico

Encryption at rest in Ella SMSC

Over the past few months, we have been quietly developing Ella SMSC, an SMS platform for private cellular networks. In order to perform its duty, Ella SMSC stores SMS messages in its embedded database. Even in private cellular deployments, the content of those messages can be highly critical (ex. one-time passwords, alarms, operational commands, etc.) This is why it always encrypts their content before storing it.

But encryption always involves encryption keys and moves the problem: where do you keep the key?

The encryption key for Ella SMSC can be stored in one of two places:

  • A key file. A protected file on the file system (or a Kubernetes Secret for K8s deployments).
  • An HSM. The key never leaves the device.

Store the encryption key on an HSM

The most secure option is to use an HSM. If the database is stolen, the attacker can't read the messages. To read SMS content, they would need the database, access to the HSM and knowledge of its PIN, all at once.

Ella SMSC natively speaks PKCS #11, the standard used to communicate with HSMs, from an affordable YubiHSM 2 to a rack-mounted Thales Luna. Pointing Ella SMSC at the HSM takes a few lines of configuration:

encryption:
  key:
    type: pkcs11
    pkcs11:
      library: /usr/lib/x86_64-linux-gnu/pkcs11/yubihsm_pkcs11.so
      token_label: YubiHSM
      pin_file: /etc/ella-smsc/hsm.pin
      key_label: ella-smsc
      mechanism: rsa-oaep

Learn more