Пример #1
0
        public void TestRandomEncryptDecrypt()
        {
            // Generate password
            var generatedPassword = Membership.GeneratePassword(12, 0);

            // Encript
            var encryptedPassword = PasswordUtility.EncryptData(generatedPassword, DataProtectionScope.LocalMachine);

            // Decript
            var decryptedPassword = PasswordUtility.DecryptData(encryptedPassword, DataProtectionScope.LocalMachine);

            Assert.Equals(generatedPassword, decryptedPassword);
        }