commit 72ce0f41f7d26698640586d18702cd79b441dcc1 Author: juanjo Date: Fri Oct 27 12:22:39 2023 +0200 Código diff --git a/.vs/Seguridad/v16/.suo b/.vs/Seguridad/v16/.suo new file mode 100644 index 0000000..07889b7 Binary files /dev/null and b/.vs/Seguridad/v16/.suo differ diff --git a/01-Seguridad/01-Seguridad.csproj b/01-Seguridad/01-Seguridad.csproj new file mode 100644 index 0000000..fa7e931 --- /dev/null +++ b/01-Seguridad/01-Seguridad.csproj @@ -0,0 +1,84 @@ + + + + + Debug + AnyCPU + {D9710F8B-8C29-48AE-B72D-A1365F2F85F8} + WinExe + _01_Seguridad + 01-Seguridad + v4.7.2 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/01-Seguridad/App.config b/01-Seguridad/App.config new file mode 100644 index 0000000..56efbc7 --- /dev/null +++ b/01-Seguridad/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/01-Seguridad/CodeFile1.cs b/01-Seguridad/CodeFile1.cs new file mode 100644 index 0000000..a38bce2 --- /dev/null +++ b/01-Seguridad/CodeFile1.cs @@ -0,0 +1,49 @@ +private void button5_Click(object sender, EventArgs e) { + string mensaje = this.textBox4.Text; + string publicKeyFile = "publicKey.xml"; + string privateKeyFile = "privateKey.xml"; + generarClaves(publicKeyFile, privateKeyFile); + + byte[] Encriptado = encriptar(publicKeyFile, Encoding.UTF8.GetBytes(mensaje)); + byte[] Desencriptado = Desencriptar(privateKeyFile, Encriptado); + + this.label7.Text = BitConverter.ToString(Encriptado); + this.label8.Text = Encoding.UTF8.GetString(Desencriptado); +} + +private static void generarClaves(string publicKF, string privateKF) { + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + + if (File.Exists(publicKF)) + File.Delete(publicKF); + if (File.Exists(privateKF)) + File.Delete(privateKF); + + string publicKey = rsa.ToXmlString(false); + File.WriteAllText(publicKF, publicKey); + string privateKey = rsa.ToXmlString(true); + File.WriteAllText(privateKF, privateKey); + } +} + +public static byte[] encriptar(string publicKF, byte[] textoPlano) { + byte[] encriptado; + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + string publicKey = File.ReadAllText(publicKF); + rsa.FromXmlString(publicKey); + encriptado = rsa.Encrypt(textoPlano, true); + } + return (encriptado); +} +public static byte[] Desencriptar(string privateKF, byte[] textoEncriptado) { + byte[] Desencriptado; + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + string privateKey = File.ReadAllText(privateKF); + rsa.FromXmlString(privateKey); + Desencriptado = rsa.Decrypt(textoEncriptado, true); + } + return (Desencriptado); +} \ No newline at end of file diff --git a/01-Seguridad/Form1.Designer.cs b/01-Seguridad/Form1.Designer.cs new file mode 100644 index 0000000..d5e2fb6 --- /dev/null +++ b/01-Seguridad/Form1.Designer.cs @@ -0,0 +1,256 @@ + +namespace _01_Seguridad { + partial class Form1 { + /// + /// Variable del diseñador necesaria. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Limpiar los recursos que se estén usando. + /// + /// true si los recursos administrados se deben desechar; false en caso contrario. + protected override void Dispose(bool disposing) { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Código generado por el Diseñador de Windows Forms + + /// + /// Método necesario para admitir el Diseñador. No se puede modificar + /// el contenido de este método con el editor de código. + /// + private void InitializeComponent() { + this.button1 = new System.Windows.Forms.Button(); + this.label1 = new System.Windows.Forms.Label(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.button2 = new System.Windows.Forms.Button(); + this.label2 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.button3 = new System.Windows.Forms.Button(); + this.textBox2 = new System.Windows.Forms.TextBox(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.button4 = new System.Windows.Forms.Button(); + this.textBox3 = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.button5 = new System.Windows.Forms.Button(); + this.label7 = new System.Windows.Forms.Label(); + this.textBox4 = new System.Windows.Forms.TextBox(); + this.label8 = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(34, 23); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(109, 37); + this.button1.TabIndex = 0; + this.button1.Text = "MD5"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(175, 35); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(70, 13); + this.label1.TabIndex = 1; + this.label1.Text = "Valor HASH: "; + // + // openFileDialog1 + // + this.openFileDialog1.FileName = "openFileDialog1"; + // + // button2 + // + this.button2.Location = new System.Drawing.Point(34, 66); + this.button2.Name = "button2"; + this.button2.Size = new System.Drawing.Size(109, 37); + this.button2.TabIndex = 2; + this.button2.Text = "Cifrado Casero"; + this.button2.UseVisualStyleBackColor = true; + this.button2.Click += new System.EventHandler(this.button2_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(290, 78); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(75, 13); + this.label2.TabIndex = 3; + this.label2.Text = "Texto cifrado: "; + // + // textBox1 + // + this.textBox1.Location = new System.Drawing.Point(149, 75); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(135, 20); + this.textBox1.TabIndex = 4; + this.textBox1.Text = "hola cifrado casero"; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(34, 109); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(109, 37); + this.button3.TabIndex = 5; + this.button3.Text = "DES a fichero"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // textBox2 + // + this.textBox2.Location = new System.Drawing.Point(149, 118); + this.textBox2.Name = "textBox2"; + this.textBox2.Size = new System.Drawing.Size(135, 20); + this.textBox2.TabIndex = 7; + this.textBox2.Text = "Texto a cifrar con DES"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(290, 118); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(75, 13); + this.label3.TabIndex = 6; + this.label3.Text = "Texto cifrado: "; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(290, 133); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(92, 13); + this.label4.TabIndex = 8; + this.label4.Text = "Texto descifrado: "; + // + // button4 + // + this.button4.Location = new System.Drawing.Point(34, 152); + this.button4.Name = "button4"; + this.button4.Size = new System.Drawing.Size(109, 37); + this.button4.TabIndex = 9; + this.button4.Text = "AES"; + this.button4.UseVisualStyleBackColor = true; + this.button4.Click += new System.EventHandler(this.button4_Click); + // + // textBox3 + // + this.textBox3.Location = new System.Drawing.Point(149, 161); + this.textBox3.Name = "textBox3"; + this.textBox3.Size = new System.Drawing.Size(135, 20); + this.textBox3.TabIndex = 11; + this.textBox3.Text = "Texto a cifrar con AES"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(290, 161); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(75, 13); + this.label5.TabIndex = 12; + this.label5.Text = "Texto cifrado: "; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(290, 176); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(92, 13); + this.label6.TabIndex = 13; + this.label6.Text = "Texto descifrado: "; + // + // button5 + // + this.button5.Location = new System.Drawing.Point(34, 195); + this.button5.Name = "button5"; + this.button5.Size = new System.Drawing.Size(109, 37); + this.button5.TabIndex = 14; + this.button5.Text = "RSA"; + this.button5.UseVisualStyleBackColor = true; + this.button5.Click += new System.EventHandler(this.button5_Click); + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(290, 204); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(75, 13); + this.label7.TabIndex = 16; + this.label7.Text = "Texto cifrado: "; + // + // textBox4 + // + this.textBox4.Location = new System.Drawing.Point(149, 204); + this.textBox4.Name = "textBox4"; + this.textBox4.Size = new System.Drawing.Size(135, 20); + this.textBox4.TabIndex = 15; + this.textBox4.Text = "Texto a cifrar con RSA"; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(290, 219); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(92, 13); + this.label8.TabIndex = 17; + this.label8.Text = "Texto descifrado: "; + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(800, 450); + this.Controls.Add(this.label8); + this.Controls.Add(this.label7); + this.Controls.Add(this.textBox4); + this.Controls.Add(this.button5); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.textBox3); + this.Controls.Add(this.button4); + this.Controls.Add(this.label4); + this.Controls.Add(this.textBox2); + this.Controls.Add(this.label3); + this.Controls.Add(this.button3); + this.Controls.Add(this.textBox1); + this.Controls.Add(this.label2); + this.Controls.Add(this.button2); + this.Controls.Add(this.label1); + this.Controls.Add(this.button1); + this.Name = "Form1"; + this.Text = "Form1"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.Button button2; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Button button3; + private System.Windows.Forms.TextBox textBox2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button button4; + private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Button button5; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.TextBox textBox4; + private System.Windows.Forms.Label label8; + } +} + diff --git a/01-Seguridad/Form1.cs b/01-Seguridad/Form1.cs new file mode 100644 index 0000000..aa714aa --- /dev/null +++ b/01-Seguridad/Form1.cs @@ -0,0 +1,207 @@ +using System; +using System.IO; +using System.Security.Cryptography; +using System.Windows.Forms; +using System.Text; + +namespace _01_Seguridad { + public partial class Form1 : Form { + public Form1() { + InitializeComponent(); + } + + private void button1_Click(object sender, EventArgs e) { + String nombreFichero; + + if (openFileDialog1.ShowDialog() == DialogResult.OK) { + nombreFichero = openFileDialog1.FileName; + MD5 md5 = MD5.Create(); + FileStream stream = File.OpenRead(nombreFichero); + byte[] hash = md5.ComputeHash(stream); + + this.label1.Text += BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant(); + } + } + + private void button2_Click(object sender, EventArgs e) { + String alfabeto = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZ0123456789 "; + String alfabetoCifrado = "KLMNÑOPQRSTUVWXYZ0123456789 ABCDEFGHIJ"; + + String mensaje, mensajeCifrado = ""; + mensaje = this.textBox1.Text; + for (int i = 0; i < mensaje.Length; i++) { + mensajeCifrado += alfabetoCifrado.Substring(alfabeto.IndexOf(mensaje.Substring(i, 1).ToUpper()), 1); + } + this.label2.Text += mensajeCifrado; + } + + private void button3_Click(object sender, EventArgs e) { + try { + //al crear un objeto DES se genera la key y el vector IV + DES objDES = DES.Create(); + + string textoMensaje = this.textBox2.Text; + string textoCifrado, textoDescifrado; + string fichero = "encriptaDES.txt"; + + textoCifrado = EncryptTextToFile(textoMensaje, fichero, objDES.Key, objDES.IV); + textoDescifrado = DecryptTextFromFile(fichero, objDES.Key, objDES.IV); + + this.label3.Text = textoCifrado; + this.label4.Text = textoDescifrado; + } + catch (Exception exc) { + Console.WriteLine(exc.Message); + } + } + public static string EncryptTextToFile(String Data, String FileName, byte[] Key, byte[] IV) { + try { + FileStream fStream = File.Open(FileName, FileMode.OpenOrCreate); + DES DESalg = DES.Create(); + CryptoStream cStream = new CryptoStream(fStream, + DESalg.CreateEncryptor(Key, IV), + CryptoStreamMode.Write); + StreamWriter sWriter = new StreamWriter(cStream); + sWriter.WriteLine(Data); + sWriter.Close(); + cStream.Close(); + //fStream.Close(); + fStream = File.Open(FileName, FileMode.Open); + StreamReader sr = new StreamReader(fStream); + string cifrado = sr.ReadToEnd(); + fStream.Close(); + return (cifrado); + } + catch (CryptographicException e) { + Console.WriteLine("Error criptográfico: {0}", e.Message); + return null; + } + catch (UnauthorizedAccessException e) { + Console.WriteLine("Error acceso a ficheros: {0}", e.Message); + return null; + } + } + + public static string DecryptTextFromFile(String FileName, byte[] Key, byte[] IV) { + try { + FileStream fStream = File.Open(FileName, FileMode.Open);// .OpenOrCreate); + DES DESalg = DES.Create(); + CryptoStream cStream = new CryptoStream(fStream, + DESalg.CreateDecryptor(Key, IV), + CryptoStreamMode.Read); + StreamReader sReader = new StreamReader(cStream); + string descifrado = sReader.ReadToEnd(); + sReader.Close(); + cStream.Close(); + fStream.Close(); + return descifrado; + } + catch (CryptographicException e) { + Console.WriteLine("Error criptográfico: {0}", e.Message); + return null; + } + catch (UnauthorizedAccessException e) { + Console.WriteLine("Error acceso a ficheros: {0}", e.Message); + return null; + } + } + + + private void button4_Click(object sender, EventArgs e) { + string original = this.textBox3.Text; + + //al crear un objeto AES se genera la key y el vector IV + using (Aes myAes = Aes.Create()) { + byte[] textoEncriptado = EncryptStringToBytes_Aes(original, myAes.Key, myAes.IV); + string textoDesencriptado = DecryptStringFromBytes_Aes(textoEncriptado, myAes.Key, myAes.IV); + + this.label5.Text = BitConverter.ToString(textoEncriptado); + this.label6.Text = textoDesencriptado; + } + } + static byte[] EncryptStringToBytes_Aes(string plainText, byte[] Key, byte[] IV) { + byte[] encrypted; + using (Aes aesAlg = Aes.Create()) { + aesAlg.Key = Key; + aesAlg.IV = IV; + ICryptoTransform encryptor = aesAlg.CreateEncryptor(aesAlg.Key, aesAlg.IV); + using (MemoryStream msEncrypt = new MemoryStream()) { + using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write)) { + using (StreamWriter swEncrypt = new StreamWriter(csEncrypt)) { + swEncrypt.Write(plainText); + } + encrypted = msEncrypt.ToArray(); + } + } + } + return encrypted; + } + static string DecryptStringFromBytes_Aes(byte[] cipherText, byte[] Key, byte[] IV) { + string plaintext = null; + using (Aes aesAlg = Aes.Create()) { + aesAlg.Key = Key; + aesAlg.IV = IV; + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + using (MemoryStream msDecrypt = new MemoryStream(cipherText)) { + using (CryptoStream csDecrypt = new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) { + using (StreamReader srDecrypt = new StreamReader(csDecrypt)) { + plaintext = srDecrypt.ReadToEnd(); + } + } + } + } + return plaintext; + } + + private void button5_Click(object sender, EventArgs e) { + string mensaje = this.textBox4.Text; + string publicKeyFile = "publicKey.xml"; + string privateKeyFile = "privateKey.xml"; + generarClaves(publicKeyFile, privateKeyFile); + + byte[] Encriptado = encriptar(publicKeyFile, Encoding.UTF8.GetBytes(mensaje)); + byte[] Desencriptado = Desencriptar(privateKeyFile, Encriptado); + + this.label7.Text = BitConverter.ToString(Encriptado); + this.label8.Text =Encoding.UTF8.GetString(Desencriptado); + } + + private static void generarClaves(string publicKF, string privateKF) { + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + + if (File.Exists(publicKF)) + File.Delete(publicKF); + if (File.Exists(privateKF)) + File.Delete(privateKF); + + string publicKey = rsa.ToXmlString(false); + File.WriteAllText(publicKF, publicKey); + string privateKey = rsa.ToXmlString(true); + File.WriteAllText(privateKF, privateKey); + } + } + + public static byte[] encriptar(string publicKF, byte[] textoPlano) { + byte[] encriptado; + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + string publicKey = File.ReadAllText(publicKF); + rsa.FromXmlString(publicKey); + encriptado = rsa.Encrypt(textoPlano, true); + } + return (encriptado); + } + public static byte[] Desencriptar(string privateKF, byte[] textoEncriptado) { + byte[] Desencriptado; + using (var rsa = new RSACryptoServiceProvider(2048)) { + rsa.PersistKeyInCsp = false; + string privateKey = File.ReadAllText(privateKF); + rsa.FromXmlString(privateKey); + Desencriptado = rsa.Decrypt(textoEncriptado, true); + } + return (Desencriptado); + } + } +} + diff --git a/01-Seguridad/Form1.resx b/01-Seguridad/Form1.resx new file mode 100644 index 0000000..9bad2f5 --- /dev/null +++ b/01-Seguridad/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/01-Seguridad/Program.cs b/01-Seguridad/Program.cs new file mode 100644 index 0000000..8633c8c --- /dev/null +++ b/01-Seguridad/Program.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; + +namespace _01_Seguridad { + static class Program { + /// + /// Punto de entrada principal para la aplicación. + /// + [STAThread] + static void Main() { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new Form1()); + } + } +} diff --git a/01-Seguridad/Properties/AssemblyInfo.cs b/01-Seguridad/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fcc92a0 --- /dev/null +++ b/01-Seguridad/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// La información general de un ensamblado se controla mediante el siguiente +// conjunto de atributos. Cambie estos valores de atributo para modificar la información +// asociada con un ensamblado. +[assembly: AssemblyTitle("01-Seguridad")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("01-Seguridad")] +[assembly: AssemblyCopyright("Copyright © 2021")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Si establece ComVisible en false, los tipos de este ensamblado no estarán visibles +// para los componentes COM. Si es necesario obtener acceso a un tipo en este ensamblado desde +// COM, establezca el atributo ComVisible en true en este tipo. +[assembly: ComVisible(false)] + +// El siguiente GUID sirve como id. de typelib si este proyecto se expone a COM. +[assembly: Guid("d9710f8b-8c29-48ae-b72d-a1365f2f85f8")] + +// La información de versión de un ensamblado consta de los cuatro valores siguientes: +// +// Versión principal +// Versión secundaria +// Número de compilación +// Revisión +// +// Puede especificar todos los valores o usar los valores predeterminados de número de compilación y de revisión +// utilizando el carácter "*", como se muestra a continuación: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/01-Seguridad/Properties/Resources.Designer.cs b/01-Seguridad/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ecfa789 --- /dev/null +++ b/01-Seguridad/Properties/Resources.Designer.cs @@ -0,0 +1,66 @@ +//------------------------------------------------------------------------------ +// +// Este código fue generado por una herramienta. +// Versión de runtime: 4.0.30319.42000 +// +// Los cambios de este archivo pueden provocar un comportamiento inesperado y se perderán si +// el código se vuelve a generar. +// +//------------------------------------------------------------------------------ + + +namespace _01_Seguridad.Properties { + /// + /// Clase de recurso fuertemente tipado para buscar cadenas traducidas, etc. + /// + // StronglyTypedResourceBuilder generó automáticamente esta clase + // a través de una herramienta como ResGen o Visual Studio. + // Para agregar o quitar un miembro, edite el archivo .ResX y, a continuación, vuelva a ejecutar ResGen + // con la opción /str o recompile su proyecto de VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Devuelve la instancia ResourceManager almacenada en caché utilizada por esta clase. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_01_Seguridad.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Invalida la propiedad CurrentUICulture del subproceso actual para todas las + /// búsquedas de recursos usando esta clase de recursos fuertemente tipados. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/01-Seguridad/Properties/Resources.resx b/01-Seguridad/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/01-Seguridad/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/01-Seguridad/Properties/Settings.Designer.cs b/01-Seguridad/Properties/Settings.Designer.cs new file mode 100644 index 0000000..9078c59 --- /dev/null +++ b/01-Seguridad/Properties/Settings.Designer.cs @@ -0,0 +1,27 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + +namespace _01_Seguridad.Properties { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/01-Seguridad/Properties/Settings.settings b/01-Seguridad/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/01-Seguridad/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/01-Seguridad/bin/Debug/encriptaDES.txt b/01-Seguridad/bin/Debug/encriptaDES.txt new file mode 100644 index 0000000..f8ed8c5 --- /dev/null +++ b/01-Seguridad/bin/Debug/encriptaDES.txt @@ -0,0 +1 @@ +TE@OM;w(.~2kU rzH1xagPmxscjlHoIJNGcT0hh0GJE3ymoDwHqbQN8SfhNuEVMNg1p48XoezoFxI9jZLt0FjcvKBZfRr38jK4RFAEPijrO4glDwUFEfhjtuhGh0yqZc9qOyyJYk7FcK3JoeAZuGhbTLdkwhPhmJx4KURnpr1FnkYiYD8qOvg4lsHSV7nQLNmriOcAeXqOqTzvnV7xf8eV1MOsfJNJLccm3kHcOUp+3+ONY3pY9dozEo54ZOi3EY2a2xEIJyeIShWX/oQWXzbKjMdIlJ6KNFxBlAvvVVSuW73JyNlGkpXnJZRQmByQSXIimGbp8rZssMOCcd0jy9XFPaLiQgTKmhoF1RQ==AQAB

7WcqbzADwHaaq5vZak5EEm0eRZl/Ln5/X4zPKJzqJ8Gbxwrt/wwwQeUjXK0scTzcXrlyNwjQTr6N2a7vQe6sYax9DyESu8+oq2ajegYsxq/LBjwgHKvw2y4GGkqoauZOSM6zCbcfXQ3pdaZPPuqw+UIwk0pOfdF481yB8bKC7PM=

3II/JTseFUN0Z4GXXalOZovJYmuegWX+B4h4exqJRGfbws52pwciRuZUM7kcVPRvMhFlrl/ekZDFn1Y9EG7tOIaQQe1e26WmIITkO8n0E0rcxzvvm0/E09CS6DztFo2WRgpnZ+vzjhD1VFElNLi5Ybbyl1wVL7FgCNqFqC9dQuc=cO+4HybfUgraL7M3bbwH5CAm24NXHn4tB/6Lek2TkxAmlDzd1Ywt1Ns1xFvZnZEPYLyl2gqGVj+OabUvutTZCqos4Cqip9f07H0qXd1cJbTxR2kI+brOHOa7HnzPu/MN4NL8Fy4XbIQ2wLI6Vrr9L8bOJvOdfXtOJ6+lXZ7HbAM=kQJuODOqUt1rPW4xdnySfElNBBY1xG6oIZgTcxE+V+fc0z0nNiww1GM/2EvRX+TnAwwBzCxrl1qXO3Ng8N+hzNxhHZnWGafTmesKlG74vX8rtTGrHn3UuF6fXW5Dk+NEgYbx/ZtjLXflfa9nQkaAUswWuIbrv9Nrjib2YmXTdN0=X2HUm8Oqro31pSII33day8jXMzyXGs4fDO8ejVNXfwQe6vLu8WHZiKJj9S/o/QhK0in+j3K76/OpDWkAeW0dOKhge42yETr9jyBJXcfHpjsb0pLFEfvWy1ZxK3BlFZoZWrjWMFqe8MOkGIHponsW1s+ExDc4Fnk6BXvX3Sk5mnI=ePSWWjwWjGuMWy3XlVe7GpZY7TbDQDFWrBHZBURzhxltd1reGnbStJ0Cx6jpcnvSMepDX0SjCxY4oxKLyPbJOUjrVTs11jPetPgTOHcsXsxBKTPgcsvLfNJDDJFzUGuq6Zv8Ekh//3WhonV/jxHQzmoCdOY02buvHmAVEMwzdOxiS3UGEXaTAxDI9HbRtUKN+1/drxv3Ux7vKZo9XhXfIfxv8nmDO4Pt3/FcMuvVHPA+rYRgkXKeUqouTXyoPaJEOMkLp+MkuwwCg2/o+JeGaJWz1RDATvHPky0OD5pRB5O728psHGdMA0hirCW5MkvJr4FPu5r3sY4PG9Pc9aBC/Q== \ No newline at end of file diff --git a/01-Seguridad/bin/Debug/publicKey.xml b/01-Seguridad/bin/Debug/publicKey.xml new file mode 100644 index 0000000..41e2e45 --- /dev/null +++ b/01-Seguridad/bin/Debug/publicKey.xml @@ -0,0 +1 @@ +zH1xagPmxscjlHoIJNGcT0hh0GJE3ymoDwHqbQN8SfhNuEVMNg1p48XoezoFxI9jZLt0FjcvKBZfRr38jK4RFAEPijrO4glDwUFEfhjtuhGh0yqZc9qOyyJYk7FcK3JoeAZuGhbTLdkwhPhmJx4KURnpr1FnkYiYD8qOvg4lsHSV7nQLNmriOcAeXqOqTzvnV7xf8eV1MOsfJNJLccm3kHcOUp+3+ONY3pY9dozEo54ZOi3EY2a2xEIJyeIShWX/oQWXzbKjMdIlJ6KNFxBlAvvVVSuW73JyNlGkpXnJZRQmByQSXIimGbp8rZssMOCcd0jy9XFPaLiQgTKmhoF1RQ==AQAB \ No newline at end of file diff --git a/01-Seguridad/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs b/01-Seguridad/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs new file mode 100644 index 0000000..3871b18 --- /dev/null +++ b/01-Seguridad/obj/Debug/.NETFramework,Version=v4.7.2.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] diff --git a/01-Seguridad/obj/Debug/01-Seguridad.csproj.AssemblyReference.cache b/01-Seguridad/obj/Debug/01-Seguridad.csproj.AssemblyReference.cache new file mode 100644 index 0000000..c0b74cf Binary files /dev/null and b/01-Seguridad/obj/Debug/01-Seguridad.csproj.AssemblyReference.cache differ diff --git a/01-Seguridad/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/01-Seguridad/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache new file mode 100644 index 0000000..ca030b9 Binary files /dev/null and b/01-Seguridad/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/Seguridad.sln b/Seguridad.sln new file mode 100644 index 0000000..55b35dd --- /dev/null +++ b/Seguridad.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31410.357 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "01-Seguridad", "01-Seguridad\01-Seguridad.csproj", "{D9710F8B-8C29-48AE-B72D-A1365F2F85F8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D9710F8B-8C29-48AE-B72D-A1365F2F85F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D9710F8B-8C29-48AE-B72D-A1365F2F85F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D9710F8B-8C29-48AE-B72D-A1365F2F85F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D9710F8B-8C29-48AE-B72D-A1365F2F85F8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7BAFB6F9-0F53-48AD-AE96-DD2845C1EB4A} + EndGlobalSection +EndGlobal