Dr. Clemens Wickboldt

Estimated reading time: 8 minutes

Techblog

Key management solutions overview

Data security is crucial, especially for personal data, to gain and maintain the trust of users. Efforts to ensure a high level of data security are enshrined in legislation as the General Data Protection Regulation (GDPR), which has been in force since May 2018. Since then, compliance with the GDPR ensures the basis for the…

Techblog

Data security is crucial, especially for personal data, to gain and maintain the trust of users. Efforts to ensure a high level of data security are enshrined in legislation as the General Data Protection Regulation (GDPR), which has been in force since May 2018. Since then, compliance with the GDPR ensures the basis for the protection of personal data.

Encryption and digital signatures to ensure the authenticity of data contribute to achieving a high level of data security. In distributed systems (e.g. blockchain applications) cryptographic procedures play a special role. Digital signatures based on public key cryptography enable a user to sign transactions. The ID can be stored together with the corresponding keys in software or hardware wallets. This creates the basis for crypto custody.

Crypto custody

With the turn of the year 2020, the so-called Act on the Implementation of the Amending Directive to the Fourth EU Money Laundering Directive is in force; it defines crypto custody as a financial service within the meaning of the German Banking Act. This includes, among other things, the custody of cryptographic keys in the context of handling crypto assets  [1]. Accordingly, affected companies need a licence from the German Federal Financial Supervisory Authority. There is to be a transitional solution for already existing offers  [2]. Originally, it was planned that this authorisation would only be granted to companies that do not perform any other activities requiring a licence, for example banks  [3]. However, this part of the legislation has not come to pass, banks are able to request permission to offer crypto custody, in addition to their core business. This means that another sector is now participating in the market and must think about how to secure the cryptographic material.

Key management solutions overview

The management of the keys required for the cryptographic procedures depends on design decisions for the overall system. Various key management solutions (KMS) can be used to manage the keys. The solutions differ first of all in the form of storage used, which can be a file system, memory, hardware security module (HSM) or a database [4], whereby the file system and the HSM are the most frequently used forms of storage. Furthermore, the KMS can be divided into two groups:

  • Non-Custodian: the keys are held exclusively by the user personally
  • Custodian: the keys are held by a central authority

This article provides an insight into how HSM solutions work and are used while differentiating between non-custodian and custodian KMS.

Hardware Security Modul

A HSM is a specialised hardware that makes it possible to store cryptographic keys in a particularly secure form and to apply them in a performant manner [5]. A distinction must be made between:

  • Dedicated HSMs (e.g. NFC tokens, USB tokens, smart cards)
  • HSM in individual devices (e.g. smartphones)
  • HSM in a data centre

An example of a dedicated HSM is the YubiHSM [6] on a USB stick. Cryptographic operations such as signing are available via a SDK. Dedicated HSMs are occasionally installed on smartphones, which are used to store private keys and provide cryptographic operations such as encryption or digital signatures.

HSMs in smartphones

Beginning with the iPhone 5s, a dedicated HSM has been built into Apple smartphones and is used, for example, to secure TouchID or FaceID. The HSM module in the iPhone can be addressed via the Apple CryptoKit [7]. It offers the following cryptographic operations:

  • Calculating and comparing cryptographic digests
  • Public key cryptography for the creation and verification of digital signatures and for key exchange

In addition to working with keys stored in memory, private keys can also be used, which are stored in and managed by the Secure Enclave. The Secure Enclave is a hardware-based key manager that is isolated from the rest of the system. The key is not accessed directly. Instead, operations are performed against the Secure Enclave for key generation, encryption of data and cryptographic signatures.

For Android smartphones, the use of HSMs is not uniformly regulated. Each manufacturer relies on its own solutions for storing the private keys and the libraries for accessing the keys. Not all manufacturers work with HSMs. In case of doubt, private keys are stored on the general file system. This is different with Samsung (e.g. Galaxy S10) and Google (e.g. Pixel 3), which work with HSMs. With its own SDK [8], the Samsung Galaxy S10 offers a solution similar to the Apple Cryptokit, but relies in part on other cryptographic processes. Unlike the Apple Cryptokit, the Samsung solution is blockchain-specific, so that it can be used as a wallet for tokens.

HSMs in data centers are used to store private keys in order to provide custodian KMS as a service.

Custodian

Custodian solutions offer key storage and cryptographic operations as a service, whereby the keys themselves are secured on a HSM. An interface enables cryptographic operations, the key never leaves the HSM. Ledger [9] as well as Amazon [10] and Microsoft [11] offer such services. The advantage of KMS as a Service lies in automated backup and recovery procedures. In case of losing access to the KMS, the key persists in the HSM module in any case. Furthermore, keys can rotate automatically in custodian solutions without the user having to control the process manually.

Non-Custodian

Software wallets use the infrastructure of generic hardware. The main difference to dedicated hardware solutions lies in the fact that the devices with software wallets can potentially be connected to the internet. The user’s own private key is encrypted and stored on the file system. When initializing the software wallet, the user sets a password and a secret backup phrase. Decryption is done by entering the previously defined password. If the password is lost, the encryption can be reset by entering the secret phrase. Common solutions are the browser plug-in Metamask or the browser Brave.

Unlike software wallets, hardware wallets are airgapped, which means they cannot be connected to the internet. Ledger[12] and Trezor [13] are two widely used hardware wallets on the market. Essentially, both solutions offer the possibility of storing private keys on the device, protecting them with a password and the possibility to restore them with a secret seed phrase. Digital signatures can be generated on the basis of the stored key, which makes token management possible.

The security of the respective wallet can be further increased by using signatures of several parties [14]. In order to sign a transaction, consensus between several parties has to be achieved. Rules for reaching consensus can be defined in a smart contract. Transactions can only be executed if they are confirmed by a predefined number of wallets. This avoids a single point of failure, which leads to the loss of all the values controlled by the account in the event of the loss or compromise of the private key in a single wallet.

The target environment is crucial

The choice of KMS depends on the characteristics of the target environment. If security and privacy of the data have a higher priority than user-friendliness or recovery options, hardware wallets can be used. Software wallets are particularly suitable for proof of concepts, as they can be used quickly and easily via browser integration. If in doubt, larger systems will fall back on custodian solutions, as they offer convenient options for managing the keys.


Sources

[1] Bundesanzeiger Verlag, Bundesgesetzblatt: Gesetz zur Umsetzung der Änderungsrichtlinie zur Vierten EU-Geldwäscherichtlinie, vol. 2019, no. 50. 2019, pp. 2602–2632.

[2] Bundesanstalt für Finanzdienstleistungsaufsicht (BaFin), “Kryptoverwahrungsgeschäft,” 2020. [Online]. Available: https://www.bafin.de/DE/Aufsicht/BankenFinanzdienstleister/Zulassung/Kryptoverwahrgeschaeft/kryptoverwahrgeschaeft_node.html. [Accessed: 03-Feb-2020].

[3] Finanzausschuss des Deutschen Bundestags, “Beschlussempfehlung: Masterplan gegen Geldwäsche – Finanzkriminalität bekämpfenDeutscher Bundestag,” no. Drucksache 19/15163, 2019.

[4] Hyperledger 2019, “Docs » Developing Applications » Application design elements » Wallet,” 2019. [Online]. Available: https://hyperledger-fabric.readthedocs.io/en/release-1.4/developapps/wallet.html. [Accessed: 03-Feb-2020].

[5] Bundesamt für Sicherheit in der Informationstechnik (BSI), “Glossar der Cyber-Sicherheit.” [Online]. Available: https://www.bsi.bund.de/DE/Themen/Cyber-Sicherheit/Empfehlungen/cyberglossar/Functions/glossar.html?cms_lv2=9817286. [Accessed: 03-Feb-2020].

[6] Yubico, “YubiHSM.” [Online]. Available: https://www.yubico.com/products/hardware-security-module/. [Accessed: 03-Feb-2020].

[7] Apple, “Apple CryptoKit Documentation.” [Online]. Available: https://developer.apple.com/documentation/cryptokit/. [Accessed: 03-Feb-2020].

[8] Samsung, “Samsung Blockchain Platform SDK.” [Online]. Available: https://developer.samsung.com/blockchain/platform/overview.html. [Accessed: 03-Feb-2020].

[9] Ledger SAS, “Ledger Vault.” [Online]. Available: https://www.ledger.com/vault/. [Accessed: 03-Feb-2020].

[10] Amazon Web Services, “AWS Key Management Service Cryptographic Details,” 2018.

[11] Microsoft Azure, “Azure Key Vault basic concepts.” [Online]. Available: https://docs.microsoft.com/en-us/azure/key-vault/basic-concepts. [Accessed: 03-Feb-2020].

[12] Ledger SAS, “Ledger Homepage.” [Online]. Available: https://www.ledger.com. [Accessed: 03-Feb-2020].

[13] SatoshiLabs, “Trezor Homepage.” [Online]. Available: https://trezor.io/. [Accessed: 03-Feb-2020].

[14] Gnosis, “Gnosis Safe Documentation,” Jan 23, 2020, 2020.


About the author

Dr. Clemens Wickboldt

Lead Software Engineer – Digital Design & Engineering

Dr. Clemens Wickboldt, joined MaibornWolff in 2019 and is now with Digital Design and Engineering. As a PhD in Information Systems, I was trained to be the interface between design and engineering. Over time, I deepened my knowledge in software engineering of web applications. Today, I’m mostly in the role of Tech Lead on our projects, making sure that the work of our Digital Designers and the work of our Software Engineers result in a great product.

LinkedIn (https://www.linkedin.com/in/clemenswickboldt/)