AES-256-GCM and PBKDF2: how the encryption protecting your vault works
How your master password becomes a key, what 600,000 rounds are for, and how AES-256-GCM protects your vault, explained in plain words.
- #encryption
- #security
- #technical
Password managers are often sold with phrases like "military-grade encryption", with little said about what that means. Here is how Open Password protects your vault, in two steps: first a key is derived, then the vault is encrypted.
Step 1: turning the master password into a key (PBKDF2)
Your master password is not used directly as the encryption key. It is first turned into a key with an algorithm called PBKDF2. PBKDF2 deliberately repeats this work many times; in Open Password the number is 600,000 rounds.
Why so many? If an attacker gets hold of your vault file, all they can do is try to guess your master password. With 600,000 rounds of work per guess, the number of guesses they can make each second drops sharply. For you, it is a delay too short to notice when you open your vault.
Step 2: encrypting the vault (AES-256-GCM)
With the derived key, the vault is encrypted using AES-256-GCM:
- AES is the most widely used encryption standard in the world.
- 256 is the key length (256 bits). With what we know today, breaking it by brute force is not practical.
- GCM mode, besides encrypting the data, also checks whether it has been changed. If someone tampers with the encrypted vault, it is noticed when you open it.
It all happens on your device
Both steps happen on your device. Only encrypted files go to storage, whether that is your browser, GitHub or your own server. Your master password never leaves your device and is not stored anywhere.
Summary
PBKDF2 makes guessing your master password slow, and AES-256-GCM makes your vault unreadable and tamper-evident. Together they make sure nobody but you can open it.