예제 #1
0
        static private XmlDocument DesEncriptarParametros(string FicheroParametros)
        {
            byte[] buffer = File.ReadAllBytes(FicheroParametros);
            string xmlDoc = Cadenas.Desencriptar(buffer);

            // Crear XmlDocument.
            XmlDocument xmlPar = new XmlDocument();

            xmlPar.LoadXml(xmlDoc);
            return(xmlPar);
        }
예제 #2
0
        private string DesencriptarPassword(string parametro)
        {
            int pos1 = parametro.ToUpper().IndexOf("PASSWORD=[[");

            if (pos1 >= 0)
            {
                pos1 += 11;
                int pos2 = parametro.IndexOf("]]", pos1);
                if (pos2 >= 0)
                {
                    string clave64     = parametro.Substring(pos1, pos2 - pos1);
                    byte[] claveEncrip = Base64Decode(clave64);
                    string clave       = Cadenas.Desencriptar(claveEncrip);
                    parametro = parametro.Substring(0, pos1 - 2) + clave + parametro.Substring(pos2 + 2);
                }
            }
            return(parametro);
        }