Yeah, sure. Vault, like most encryption systems, uses an encryption key under the system. It has a symmetric encryption key.
That encryption key encrypts the data in the durable storage backend. Where data is written The most logical there is disk, but Vault can also write to a database or it can write to in-memory. The encryption key is what’s responsible for encrypting that data once it’s sitting at rest on some type of durable storage.
That encryption key is a static key. Vault has commands that allow you to rotate that key at any time. And it uses a key ring so that it can automatically upgrade over time as new data comes in and data is rewritten.
That encryption key itself is actually encrypted by what we call the master key. And the master key never exists in Vault. Instead, the master key is decomposed into a number of shares.
And a threshold of those shares must come together to regenerate the master key. And this is done via an algorithm. It’s a computer science algorithm called Shamir secret sharing.
And the analogy I always like to use here is if you had a physical key to a door, you know, a deadbolt or a door lock, and you cut that into five pieces and you gave five people a piece of that key. If somehow any three people could come together and put their pieces of the key together, super glue them back together, that could unlock the door. That’s actually how Shamir’s secret sharing algorithm works.
So what we do whenever we initialize a vault, the process of initialization generates a master key. That master key is then split into a threshold of keys that get distributed to a number of users in your organization. And then that master key never exists again.
It only ever existed in memory. In order to decrypt the encryption key, we need the master key. And in order to get the master key, a threshold of users have to come together and enter their shard or their piece of that master key in order to regenerate it.
And this is Shamir’s secret sharing algorithm. In Vault, that shard, that piece of the key, is what we call an unseal key. So when a vault is created and initialized, it comes up in what’s called a sealed state.
The sealed state means that no requests are served and the data in vault is not available. It’s currently encrypted and we need to generate the master key so that we can decrypt the encryption key so that we can read and write the data. Only after a threshold of the key shares have been entered can we generate the master key, and then that master key can decrypt the encryption key, and Vault can be operable.
And this is the process known as unsealing. So if you’ve ever seen a movie where the president or the prime minister… has to enter the secret codes to disarm the nuclear missile, and three people have to enter their code in order to disarm the missile. That’s actually very similar to how Volt internally works.
And this is part of that internal threat that I talked about earlier. The Shamir secret sharing algorithm prevents one person from having complete reign over the system. Instead, there’s a system of checks and balances in place. such that no one operator can go rogue without the other operators in collusion or intervening.