Cellar
- 受 Bitcoin HD wallet 启发(BIP-32 Hierachical Deterministic Wallets)
- 密码可以从一个根密码一层层派生下去
- 每个父密码可以派生子密码,结果跟从根密码派生一样
salt = Secure-Random(output_length=32)
stretched_key = Argon2(passphrase=user_passphrase, salt=salt)
auth_key = HMAC-BLAKE2s(key=stretched_key, "Auth Key")
c1 = HMAC-BLAKE2s(key=stretched_key, "Master Key")
c2 = Secure-Random(output_length=32)
encrypted_c2 = ChaCha20(c2, key=auth_key, nonce=salt[0..CHACHA20_NONCE_LENGTH])
master_key = HMAC-BLAKE2s(key=c1, c2)
application_key = HMAC-BLAKE2s(key=master_key, "app info, e.g. yourname@gmail.com")