public void DecryptStringWithDPAPITest() { var testString = "this is a test string"; var secureTestString = EncryptionUtility.ToSecureString(testString); var encryptedString = EncryptionUtility.EncryptStringWithDPAPI(secureTestString); var decryptedString = EncryptionUtility.DecryptStringWithDPAPI(encryptedString); var insecureString = EncryptionUtility.ToInsecureString(decryptedString); Assert.IsTrue(insecureString == testString); }