Example #1
0
        private static string CheckEncryptDecryptPasswordV2(string password, string masterPassword)
        {
            string masterKey         = CalculateNewMasterPasswordKey(masterPassword);
            string encryptedPassword = PasswordFunctions2.EncryptPassword(password, masterKey);
            string decryptedPassword = PasswordFunctions2.DecryptPassword(encryptedPassword, masterKey);

            Assert.AreEqual(password, decryptedPassword, "Unable to decrypt password");
            return(encryptedPassword);
        }
Example #2
0
        public void V2PasswordsEncryptDecryptTest()
        {
            PasswordsEncryptDecryptCheck(CheckEncryptDecryptPasswordV2);

            string masterKey         = CalculateNewMasterPasswordKey(MASTERPASSWORD);
            string decryptedPassword = PasswordFunctions2.DecryptPassword(string.Empty, masterKey);

            Assert.AreEqual(string.Empty, decryptedPassword, "Decryption of empty stored password failed");
        }
Example #3
0
 /// <summary>
 /// Use only to resolve settings file passwords
 /// </summary>
 internal string DecryptPassword(string encryptedPassword)
 {
     return(PasswordFunctions2.DecryptPassword(encryptedPassword, this.KeyMaterial));
 }