public static string GetCryptography(eTypeCryptography typeCryptography, string content, string key = null) { string cryptography = string.Empty; try { if (Validate(typeCryptography, content, key)) { switch (typeCryptography) { case eTypeCryptography.DES: cryptography = DESCripto.ToCrypt(key, content); break; case eTypeCryptography.AES: cryptography = AESCripto.ToCrypt(key, content); break; case eTypeCryptography.SHA256: cryptography = SHA256.ToCrypt(content); break; case eTypeCryptography.MD5: cryptography = MD5Cript.ToCrypt(content); break; case eTypeCryptography.ZenitPolar: cryptography = Zenit_Polar.ToCript(content); break; case eTypeCryptography.RSA: cryptography = RSACripto.Encrypt(content); break; } } return(cryptography); } catch (Exception e) { throw e; } finally { cryptography = string.Empty; } }