private SymmetricCrypto createCrypto(string arithmetic) { SymmetricAlgorithmType result; if (string.IsNullOrWhiteSpace(arithmetic)) { result = SymmetricAlgorithmType.TripleDES; } else if (!Enum.TryParse <SymmetricAlgorithmType>(arithmetic, out result)) { throw new CryptographicException(string.Format("Invalid arithmetic:{0}", (object)arithmetic)); } return(SymmetricCrypto.Create(this.getCryptoKey(), result)); }