Open chenkins opened 1 year ago
@overheadhunter could you detail on what we need for v1 with respect to https://iterate-ch.atlassian.net/wiki/spaces/ITERATE/pages/26574860/2023-09-13+Meeting+notes ?
Ich werden den Key Rotation Mechanismus mal ausdefinieren und dabei Migrationspfade im Blick behalten. xattr können wir problemlos zum bestehenden Format hinzufügen. Max Dateinamens/Pfad-Länge sollten wir hard cappen und auf Shortening verzichten. Damit haben wir ein robustes Fundament
@overheadhunter what about https://github.com/encryption-alliance/unified-vault-format/pull/19/files - does this imply modifications for v1?
Yes I plan to support key rotation from day 1, as adding it later is a risky migration that may be exploited by downgrade attacks.
@overheadhunter do we need more than https://github.com/shift7-ch/cipherduck-hub/pull/1/files#r1448542864 for v1?
@overheadhunter do we need more than https://github.com/shift7-ch/cipherduck-hub/pull/1/files#r1448542864 for v1?
This one is unrelated to key rotation. So, this one is not sufficient. I'll try to draft the minimal diff required to add key rotation as specified in https://github.com/encryption-alliance/unified-vault-format/pull/19 to our existing vault format.
Discussion with @overheadhunter
Migration MUST requirements
Migrations SHOULD requirements
Cipherduck Strategy We do a merge
Implementation
Migration risks w.r.t. uvf-to-be
nameFormat
/nameKey
)fileFormat
)metadata.uvf
= Vault Key JWENext steps
key
attribute in JWE.As far as I can see, cryptolib
is used with
final FileHeader header = cryptomator.getFileHeaderCryptor().create();
cryptomator.getFileHeaderCryptor().encryptHeader(header);
@overheadhunter 1) Would it make sense to extend FileHeaderCryptor.create()
to accept the Vault Key ID
? 2) File Body Encryption does not change w.r.t to vault format 8, right?
We then need to pass through the Vault Key ID
from vault loading to header creation. (To be discussed with @ylangisc / @dkocher ).
Discussion with @overheadhunter
1. device key (EC) decrypts user key (EC)
2. user key (EC) decrypts vault masterkey (AES)
3. vault masterkey (AES) decrypts vault key
Vault Key ID
){ "key": "vault masterkey"}
/api/vaults/{vaultId}/metadata
:
{
"fileFormat": "AES-256-GCM-32k",
"nameFormat": "AES-256-SIV",
"keys": {
"QBsJ": "<vault key>",
"HDm3": "<name key>"
},
"latestFileKey": "QBsJ",
"nameKey": "HDm3",
"kdf": "1STEP-HMAC-SHA512",
"com.cipherduck.storage": {
"provider": "references storage profile",
"defaultPath": "bucket name",
"nickname": "display text in client",
"uuid": "vault ID - can be removed",
"region": "bucket region",
"username": "AccessKeyId non-STS",
"password": "SecretKey non-STS"
},
"org.cryptomator.automaticAccessGrant": {
"enabled": true,
"maxWotDepth": -1
}
}
Code
Terminlogy
VaultKey
) is used to decrypt the vault metadata, it is stored as a user-specific JWE under /api/vaults//{vaultId}/access-token
vault.uvf
) contains the vault key(s) (used to encrypt/decrypt the data), it is stored as JWE encrypted by the vault masterkey under /api/vaults/{vaultId}/metadata
.WiP diff hub: https://github.com/shift7-ch/cipherduck-hub/compare/605215b1cab5ee4188223bed05336ab4af29a8f6...feature/cipherduck WiP diff client: https://g.iterate.ch/projects/ITERATE/repos/mountainduck/compare/diff?sourceBranch=refs%2Fheads%2Ffeature%2Fcipherduck&targetRepoId=11&targetBranch=2af15e5a2bd7db93a2a37f92a88bab07cadabd65
Need to discuss with @overheadhunter
pro memoria:
0. setupCode () decrypts user key (EC) --> pbes2
1. device key (EC) decrypts user key (EC) --> ecdhEs
2. user key (EC) decrypts vault masterkey (AES) --> ecdhEs
3. vault masterkey (AES) decrypts vault key --> a256kw
recovery key handling with key rotation?
I think this is impossible in its current implementation. Instead we could add (as already requested a couple of times) recovery contacts. While regular vault members get the key immediately during key rotation, recovery contacts don't need to be members and only get part of the key, requiring 4 eyes (or more) to recover a vault
Story
Acceptance Criteria
Open Questions
Context
Implementation