Ejemplo n.º 1
0
        private void btnKey_Click(object sender, EventArgs e)
        {
            StringBuilder str = new StringBuilder();

            //Error
            //SymetriCypher<System.Security.Cryptography.TripleDES> wTripleDES = new SymetriCypher<System.Security.Cryptography.TripleDES>();


            _SymetriCypher = new SymetriCypher <RijndaelManaged>();
            //SymetriCypher<RijndaelManaged> _SymetriCypher = new SymetriCypher<RijndaelManaged>();

            //str.Append(SymetricCypherFactory.GenNewKey());


            str.AppendLine(_SymetriCypher.GeneratetNewK());
            // _SymetriCypher.Encrypt("", "j7Ab7ScPtcoxGTDANnvn3e4VJxqD+dR5bnJO6+hXn78=$HJoNwcu5Riru293Mj2dEXQ==");
            txtKey.Text = str.ToString();
        }
Ejemplo n.º 2
0
        public static string SEED_K = "SESshxdRu3p4ik3IOxM6/qAWmmTYUw8N1ZGIh1Pgh2w=$pQgQvA49Cmwn8s7xRUxHmA==";//"sec.key";

        static Common()
        {
            //SI NO HAY WRAPPERS CARGA DIRECTAMENTE 
            //if (WrapperFactory.ProviderSection.Providers.Count.Equals(0))
            //{
                CnnString = System.Configuration.ConfigurationManager.ConnectionStrings[CnnStringName].ConnectionString;
                CnnString_Entities = System.Configuration.ConfigurationManager.ConnectionStrings["HealthEntities"].ConnectionString;
            //}
           
            // SymetricCypherFactory.Cypher();// SymetricCypherFactory.Get<RijndaelManaged>(SEED_K);
            SymetriCypher<AesManaged> s = new SymetriCypher<AesManaged>(SEED_K);
            
            
            ISymetriCypher = s;

            if (System.Configuration.ConfigurationManager.AppSettings["logOnFile"] != null)
                logOnFile = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["logOnFile"]);
        }
Ejemplo n.º 3
0
        private void btnKey_Click(object sender, EventArgs e)
        {
            StringBuilder str = new StringBuilder();
       
            //Error
            //SymetriCypher<System.Security.Cryptography.TripleDES> wTripleDES = new SymetriCypher<System.Security.Cryptography.TripleDES>();
            SymetriCypher<AesManaged> c =new SymetriCypher<AesManaged> ();

            //str.Append(SymetricCypherFactory.GenNewKey());


            str.AppendLine(c.GeneratetNewK());
            c.Encrypt("", "j7Ab7ScPtcoxGTDANnvn3e4VJxqD+dR5bnJO6+hXn78=$HJoNwcu5Riru293Mj2dEXQ==");
            txtKey.Text = str.ToString();

            

        }
Ejemplo n.º 4
0
        public static string SEED_K = "SESshxdRu3p4ik3IOxM6/qAWmmTYUw8N1ZGIh1Pgh2w=$pQgQvA49Cmwn8s7xRUxHmA==";//"sec.key";

        static Common()
        {
            //SI NO HAY WRAPPERS CARGA DIRECTAMENTE
            //if (WrapperFactory.ProviderSection.Providers.Count.Equals(0))
            //{
            CnnString          = System.Configuration.ConfigurationManager.ConnectionStrings[CnnStringName].ConnectionString;
            CnnString_Entities = System.Configuration.ConfigurationManager.ConnectionStrings["HealthEntities"].ConnectionString;
            //}

            // SymetricCypherFactory.Cypher();// SymetricCypherFactory.Get<RijndaelManaged>(SEED_K);
            SymetriCypher <AesManaged> s = new SymetriCypher <AesManaged>(SEED_K);


            ISymetriCypher = s;

            if (System.Configuration.ConfigurationManager.AppSettings["logOnFile"] != null)
            {
                logOnFile = Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["logOnFile"]);
            }
        }