Simple password manager using Argon2 and AES for password protection.
Wanting to learn more about security concepts, I decided to give a shot at my own password manager application built from scratch. The application defaults to parameters tuned for my desktop but may be modified for any application. Application is currently 100% offline, using SQLite to store passwords locally. WebAPI project is currently not complete and is reserved for possible future use.
The master password is hashed using Argon2Id using a 128 bit salt, producing a 256 bit hash. Argon parameters are tuned for ~5s execution time on a Ryzen 2700X. Upon logging in, a long 64 byte key is generated to be used for data encryption in place of the user's master password.
Sensitive data such as stored passwords are encrypted with AES256. Two 256 bit keys are generated with Argon2Id (~100ms execution on Ryzen 2700X) which serve as keys for the AES and HMAC algorithms. Encrypted data is then authenticated with HMAC256 to prevent data tampering.
Parameters for the application and algorithms used can be modified in a settings file. This file should be placed at Documents/PasswordVault/PasswordVaultSettings.json
. The contents of the configuration should match below and can be modified accordingly. An example configuration is located at PasswordVault.Data\TestDb\PasswordVaultSettings.json
.
Supported key derivation algorithms:
- Argon2Id: 0 (default)
- Pbkdf2: 1 (not recommended)
Supported encryption algorithms:
- Aes256CfbPkcs7: 0 (default)
- Aes128CfbPkcs7: 1
- Rijndael256CbcPkcs7: 2
- Rijndael128CbcPkcs7: 3
Supported MAC algorithms:
- HMACSHA256 (default)
- HMACSHA512
{
"MasterPasswordParameters": {
"KeyDerivationParameters": {
"Iterations": 4,
"DegreeOfParallelism": 16,
"MemorySizeKb": 1048576,
"SaltSizeBytes": 16,
"KeySizeBytes": 32,
"Algorithm": 0
},
"RandomKeySize": 64
},
"EncryptionParameters": {
"Algorithm": 1,
"Mac": 1,
"KeyDerivationParameters": {
"Iterations": 1,
"DegreeOfParallelism": 2,
"MemorySizeKb": 1024,
"SaltSizeBytes": 16,
"KeySizeBytes": 32,
"Algorithm": 0
},
"BlockSizeBytes": 16,
"IvSizeBytes": 16
},
"TimeoutMinutes": 1
}
- Clone repository with git:
git clone https://github.com/willem445/PasswordVault.git
-
Open
PasswordVault.sln
with VS2019. -
Right click on
Solution 'PasswordVault'
and selectRestore Nuget Packages
Right click on PasswordVault.Desktop.Winforms
and select Rebuild
.
Run GenerateUnitTestingMetrics.bat
- Click on
PasswordVault.Winforms.Installer
& browse toVersion
property. Update this to release version. - Right click on
PasswordVault.Desktop.Winforms
and selectProperties
. - Under
Application
, click onAssembly Information
. UpdateAssembly version
andFile version
to release version. - Under
Publish
, change publish version to release version. - Change solution configuration to
Release
. - Right click on
PasswordVault.Winforms.Installer
and selectRebuild