public void Encrypt_Decrypt_Pass()
        {
            var one = 1;
            var two = 2;
            var three = 3;
            var four = 4;
            var five = 5;

            var cryptographyHelper = new CryptographyHelper(ConfigHelper.RegistrationEncryptionKey);

            var oneEncrypted = cryptographyHelper.Encrypt(one.ToString());
            var twoEncrypted = cryptographyHelper.Encrypt(two.ToString());
            var threeEncrypted = cryptographyHelper.Encrypt(three.ToString());
            var fourEncrypted = cryptographyHelper.Encrypt(four.ToString());
            var fiveEncrypted = cryptographyHelper.Encrypt(five.ToString());

            var oneDecrypted = cryptographyHelper.Decrypt(oneEncrypted);
            var twoDecrypted = cryptographyHelper.Decrypt(twoEncrypted);
            var threeDecrypted = cryptographyHelper.Decrypt(threeEncrypted);
            var fourDecrypted = cryptographyHelper.Decrypt(fourEncrypted);
            var fiveDecrypted = cryptographyHelper.Decrypt(fiveEncrypted);

            Assert.AreEqual(one, int.Parse(oneDecrypted));
            Assert.AreEqual(two, int.Parse(twoDecrypted));
            Assert.AreEqual(three, int.Parse(threeDecrypted));
            Assert.AreEqual(four, int.Parse(fourDecrypted));
            Assert.AreEqual(five, int.Parse(fiveDecrypted));
        }
        public void Encrypt_Iterations_Pass()
        {
            var cryptographyHelper = new CryptographyHelper(ConfigHelper.RegistrationEncryptionKey);

            var value = long.MaxValue.ToString();
            var iterations = 5;

            var encryptedValue = cryptographyHelper.Encrypt(value, iterations);

            var decryptedValue = cryptographyHelper.Decrypt(encryptedValue, iterations);

            Assert.AreEqual(value, decryptedValue);
        }
        public int GetMemberId()
        {
            var returnValue = 0;

            if (!string.IsNullOrEmpty(MemberId))
            {
                var cryptographyHelper = new CryptographyHelper(ConfigHelper.RegistrationEncryptionKey);
                var decryptedValue = cryptographyHelper.Decrypt(MemberId);

                if (!int.TryParse(decryptedValue, out returnValue))
                {
                    returnValue = 0;
                }
            }

            return returnValue;
        }
 public PasswordHelper(Guid saltValue)
 {
     cryptographyHelper = new CryptographyHelper(ConfigHelper.RegistrationEncryptionKey);
     SaltValue = saltValue;
 }