2
$\begingroup$

I am developing something like 1Password and I want to be sure that method that I use is secure. Main idea of the app is storing user passwords, and is protected with a global master password. Main scope of this post is to be sure that algorithms and logic will protect user's sensitive data from brute force, rainbow table attacks, even with special ASIC hardware

Algorithm

**All generated data are using secure random generating_random_data

Creation

  1. User define a Master Password
  2. I generate random Master Key, secret high entropy key
  3. I generate random Master Salt, this is not secret and will be appended to final public binary
  4. Derive using Argon2id from Master Password and Master Salt, 96 bytes

    • 32 bytes Derived Key
    • 32 bytes Derived Hash
    • 32 bytes Derived Salt
  5. Hash using Blake2b from Derived Hash and Derived Salt and name result Pre Hash

  6. Hash using Blake2b from Pre Hash and name result Public Hash, this hash is not secret and will be appended to final binary file
  7. Encrypt using Authenticated encryption XChaCha20Poly1305Ietf -> Master Key, with previously Derived Key and name result as Public Encrypted Master Key
  8. Save into a Public binary file Master Salt, Public Hash, Public Encrypted Master Key

Opening

  1. Read Master Password from user's input
  2. Read Master Salt from user's Public binary
  3. Derive using Argon2id from Master Password and Master Salt, 96 bytes

    • 32 bytes Derived Key
    • 32 bytes Derived Hash
    • 32 bytes Derived Salt
  4. Hash using Blake2b from Derived Hash and Derived Salt and name result Pre Hash

  5. Hash using Blake2b from Pre Hash and name result Public Hash
  6. Compare Public Hash from step 6 with saved in Public binary Public Hash that was previously saved in step 8 when created
  7. If NOT equal throw invalidPasswordOrCorruptedData
  8. If equal Decrypt using Authenticated encryption XChaCha20Poly1305Ietf -> Public Encrypted Master Key with previously Derived Key from step 4 and name result as Master Key
  9. Use Master Key to encrypt and decrypt user's sensitive data

Summary

From above logic it is clear that we encrypt Master Key with derived data from user's password and then use that Master Key to encrypt all other sensitive data

Questions

  1. Is this logic enough for protecting user's secrets ?
  2. Will it protect from brute force, rainbow table attacks ?
  3. Are there any steps that must be eliminated or useless ?

Remarks

I am using libsodium, swift-sodium for all crypto operations, and follow libsodium's best practice and suggestions

By default I am using 10 iterations and 64M of RAM for argon2id

$\endgroup$
  • 1
    $\begingroup$ Why are you developing something like 1Password? Why not help develop 1Password (or similar)? $\endgroup$ – user2768 Apr 5 '18 at 10:26
  • $\begingroup$ @user2768 I see the biggest problem with 1Password is the subscription model. While on the surface this sounds good there is a limit of how many subscription models I can handle, the minimum for 1Password is $36 or $60/yr and I must use their server. I am currently grandfathered in but that may change in the future. The problem I have with umbri is security experience, it must be secure and that is not easy. An alternative must have starting power and support. $\endgroup$ – zaph Apr 5 '18 at 11:54
  • $\begingroup$ @zaph The subscription model is certainly an issue for some (typically online) password managers, but some (typically offline) password managers do not suffer from this, e.g., KeePass, Roboform, Password Safe, ... (See en.wikipedia.org/wiki/List_of_password_managers for a long list of password managers.) $\endgroup$ – user2768 Apr 5 '18 at 12:07
  • $\begingroup$ @user2768 I think that Password Manager must be open source and open for code review, and not a black box, that somehow is working $\endgroup$ – umbri Apr 5 '18 at 12:22
  • 2
    $\begingroup$ @umbri Many password managers are open source and can be reviewed. Some aspects of such password managers can no doubt be improved, but this doesn't necessitate an entirely new password manager, it suffices to identify issues and fix them. Hence, your efforts might be better placed on an existing open source project, rather than a new project. $\endgroup$ – user2768 Apr 5 '18 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.