public string CifrarZigZag([FromForm] UploadDataZigZag CifrarZigZag) { if (!Directory.Exists(_environment.WebRootPath + "\\ArchivosCifradosZigZag\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivosCifradosZigZag\\"); } ZigZag CifradoZigZag = new ZigZag(); CifradoZigZag.CifradoZigZag(CifrarZigZag.ArchivoCargado, CifrarZigZag.TamañoCarriles, CifrarZigZag.NuevoNombre, _environment.WebRootPath + "\\ArchivosCifradosZigZag\\"); return("El archivo cifrado se encuentra en la carpeta 'ArchivosCifradosZigZag' en la Carpeta 'wwwroot' dentro de la carpeta del Laboratorio"); }
public void CifradosDatos([FromForm] DataCipher _DataCipher, string cifrado) { ZigZag _Zigzag = new ZigZag(); MetodosNecesariosC _MetodosCipher = new MetodosNecesariosC(); switch (cifrado.ToUpper()) { case "CEASER": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoCifradoCeaser\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoCifradoCeaser\\"); } _MetodosCipher.CifradoCeaser(_DataCipher.ArchivoCargado, _DataCipher.Llave, _DataCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoCifradoCeaser\\"); break; case "ZIGZAG": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoCifradoZigZag\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoCifradoZigZag\\"); } _Zigzag.CifradoZigZag(_DataCipher.ArchivoCargado, _DataCipher.TamanoCarriles, _DataCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoCifradoZigZag\\"); break; case "ESPIRAL": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoCifradoEspiral\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoCifradoEspiral\\"); } _MetodosCipher.CifradoEspiral(_DataCipher.ArchivoCargado, _DataCipher.n, _DataCipher.m, _DataCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoCifradoEspiral\\"); break; case "VERTICAL": if (!Directory.Exists(_environment.WebRootPath + "\\ArchivoCifradoVertical\\")) { Directory.CreateDirectory(_environment.WebRootPath + "\\ArchivoCifradoVertical\\"); } _MetodosCipher.CifradoVertical(_DataCipher.ArchivoCargado, _DataCipher.n, _DataCipher.m, _DataCipher.NuevoNombre, _environment.WebRootPath + "\\ArchivoCifradoVertical\\"); break; default: break; } }