Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cryptography section #237

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"cSpell.words": ["Bitwarden"]
"cSpell.words": [
"Bitwarden"
],
"editor.formatOnSave": false,
"editor.formatOnPaste": false
}
1 change: 1 addition & 0 deletions docs/contributing/cryptography/_category_.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
label: "Cryptography"
30 changes: 30 additions & 0 deletions docs/contributing/cryptography/requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Requirements

At Bitwarden we protect our users data depending heavily zero-knowledge cryptography. One of the
most important way of achieving this is by living up to the high standard required from today's and
tomorrow's cryptography. This document outlines the requirements we have to achieve those goals.

:::info
For more information about cryptography in Bitwarden, see
[Bitwarden Security Whitepaper](https://bitwarden.com/help/bitwarden-security-white-paper/)
:::

## Symmetric encryption

:::info
All keys used for symmetric encryption should be 512 bits.
:::

The symmetric encryption
algorithm used for encrypting vault data is AES-256 in CBC mode. The key size is 256 bits and the IV
size is 128 bits. The IV is randomly generated for each field and stored along with the cipher text.
Each operation is accompanied by an HMAC (message authentication code) verification to ensure
integrity.

The stored symmetric-key object consists of two concatenated keys, one used for encryption and one
used for HMAC, both 256 bits. This is what we mean when saying that the "`UserKey` is 512 bits".

### Asymmetric encryption

The asymmetric encryption algorithm used for encrypting user data is RSA-2048. The key size is 2048
bits.