public void TestHashAndEncryptFromString()
        {
            string data = "Some test data";

            byte[] encryptedData;
            string base64EncryptedData;

            using (ICrypto crypto = new AesCrypto("password!"))
            {
                encryptedData       = crypto.HashAndEncrypt(data);
                base64EncryptedData = crypto.HashAndEncryptToBase64(data);
            }

            string decryptedData;
            string decryptedDataFromBase64;

            using (ICrypto crypto = new AesCrypto("password!"))
            {
                decryptedData           = crypto.DecryptToStringAndCheckHash(encryptedData);
                decryptedDataFromBase64 = crypto.DecryptToStringAndCheckHash(base64EncryptedData);
            }

            Assert.AreEqual(data, decryptedData);
            Assert.AreEqual(data, decryptedDataFromBase64);
        }
        public void TestHashAndEncrypt()
        {
            byte[] data = CreateRandomData(1000);

            byte[] encryptedData;
            string base64EncryptedData;

            using (ICrypto crypto = new AesCrypto("password!"))
            {
                encryptedData       = crypto.HashAndEncrypt(data);
                base64EncryptedData = crypto.HashAndEncryptToBase64(data);
            }

            byte[] decryptedData;
            byte[] decryptedDataFromBase64;
            using (ICrypto crypto = new AesCrypto("password!"))
            {
                decryptedData           = crypto.DecryptAndCheckHash(encryptedData);
                decryptedDataFromBase64 = crypto.DecryptAndCheckHash(base64EncryptedData);
            }

            TestHelper.AreEqual(data, decryptedData);
            TestHelper.AreEqual(data, decryptedDataFromBase64);
        }