public void UpdatePasswordByNewKeyMaterial(string newKeymaterial) { if (!string.IsNullOrEmpty(this.SecretKey)) { this.Password = PasswordFunctions.EncryptPassword(this.SecretKey, newKeymaterial); } }
public void UpdatePasswordsByNewKeyMaterial(string newKeyMaterial) { this.EncryptedKeePassPassword = PasswordFunctions.EncryptPassword(this.KeePassPassword, newKeyMaterial); this.EncryptedDefaultPassword = PasswordFunctions.EncryptPassword(this.DefaultPassword, newKeyMaterial); this.EncryptedAmazonAccessKey = PasswordFunctions.EncryptPassword(this.AmazonAccessKey, newKeyMaterial); this.EncryptedAmazonSecretKey = PasswordFunctions.EncryptPassword(this.AmazonSecretKey, newKeyMaterial); }
public void V1PasswordsUniqueEncryptionTest() { string key = PasswordFunctions.CalculateMasterPasswordKey(MASTERPASSWORD); string encryptedPassword = PasswordFunctions.EncryptPassword(USERPASSWORD, key); string encryptedPassword2 = PasswordFunctions.EncryptPassword(USERPASSWORD, key); Assert.AreEqual(encryptedPassword, encryptedPassword2, "password encryption v1 doesn't generate identical encrypted bytes"); }
private static bool TestDatabasePassword(string connectionStringToTest, string databasePassword) { string connectionString = BuildConnectionString(connectionStringToTest); var database = new DataBase(connectionString); string databasePasswordHash = PasswordFunctions.EncryptPassword(databasePassword); bool passwordIsValid = databasePasswordHash == database.GetMasterPasswordHash(); return(passwordIsValid); }
private static string CheckEncryptDecryptPasswordV1(string password, string masterPassword) { string masterKey = PasswordFunctions.CalculateMasterPasswordKey(masterPassword); string encryptedPassword = PasswordFunctions.EncryptPassword(password, masterKey); string decryptedPassword = PasswordFunctions.DecryptPassword(encryptedPassword, masterKey); Assert.AreEqual(password, decryptedPassword, "Unable to decrypt V1 password"); return(encryptedPassword); }
public void UpdatePasswordsByNewKeyMaterial(string newKeyMaterial) { this.EncryptedKeePassPassword = PasswordFunctions.EncryptPassword(this.KeePassPassword, newKeyMaterial); this.EncryptedDefaultPassword = PasswordFunctions.EncryptPassword(this.DefaultPassword, newKeyMaterial); }