示例#1
0
        public static string CalcularECifrarMd5Informacao(string informacao, bool formatoTexto = true)
        {
            var md5 = CalcularMd5Informacao(informacao, formatoTexto);

            if (md5 is string)
            {
                return(TripleDes.Cifrar(md5.ToString(), RetornarChavePrivadaInformacaoDecifrada()));
            }
            return(TripleDes.Cifrar(BitConverter.ToString((byte[])md5), RetornarChavePrivadaInformacaoDecifrada()));
        }
示例#2
0
 public static string RetornarChavePrivadaInformacaoDecifrada()
 {
     return(TripleDes.Decifrar(ChavePrivadaInformacao, ChaveGeral).Replace(Environment.NewLine, string.Empty));
 }
示例#3
0
 public static bool DecifrarETestarMd5Informacao(string informacao, string valorHash)
 {
     return(CalcularMd5Informacao(informacao).ToString() == TripleDes.Decifrar(valorHash, RetornarChavePrivadaInformacaoDecifrada()).Replace("-", ""));
 }