Exemple #1
0
        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);
        }
Exemple #2
0
        public void V1PasswordsEncryptDecryptTest()
        {
            PasswordsEncryptDecryptCheck(CheckEncryptDecryptPasswordV1);

            string masterKey         = PasswordFunctions.CalculateMasterPasswordKey(MASTERPASSWORD);
            string decryptedPassword = PasswordFunctions.DecryptPassword(string.Empty, masterKey);

            Assert.AreEqual(string.Empty, decryptedPassword, "Decryption of empty stored password failed");
        }
Exemple #3
0
        private string MigratePassword(string oldPassword)
        {
            var securityPassword = PasswordFunctions.DecryptPassword(oldPassword, this.oldKey);

            return(PasswordFunctions2.EncryptPassword(securityPassword, this.newKey));
        }