Está en la página 1de 2

Objetivo.

- Hacer un programa

que permita la verificacin de un archivo no sea

corrupto o haya sido modificado

private static String toHexadecimal(byte[] digest) {


String hash = "";
for (byte aux : digest) {
int b = aux & 0xff;
if (Integer.toHexString(b).length() == 1) {
hash += "0";
}
hash += Integer.toHexString(b);
}
return hash;
}
public String getMD5Checksum(File archivo) {
byte[] textBytes = new byte[1024];
MessageDigest md = null;
int read = 0;
String md5 = null;
try {
InputStream is = new FileInputStream(archivo);
md = MessageDigest.getInstance("MD5");
while ((read = is.read(textBytes)) > 0) {
md.update(textBytes, 0, read);
}
is.close();
byte[] md5sum = md.digest();
md5 = toHexadecimal(md5sum);
} catch (FileNotFoundException e) {
} catch (NoSuchAlgorithmException e) {

} catch (IOException e) {
}

return md5;
}

Formulario Inicio
private void btn2ActionPerformed(java.awt.event.ActionEvent evt) {
elegir.showOpenDialog(null);
txt2.setText(ch.getMD5Checksum(elegir.getSelectedFile()));
llamar();
}
CheckSum ch = new CheckSum();
JFileChooser elegir = new JFileChooser();
void llamar() {
if (txt1.getText().equals(txt2.getText())) {
lblres.setText("Archivo Seguro");
} else {
lblres.setText("Archivo Inseguro");
}
}

Conclusin.- Se llev acabo que al utilizar estos tipos de ataques que tienen la
capacidad de captar si existe diferentes archivos y podamos verificar dos archivos son
corruptos o diferentes en su estructura interna.
Recomendacin.- siempre se debe tener en cuenta para saber de dnde se obtiene los
archivos yaqu estos pueden haber sido modificados y contenga irregularidades en su
contenido lo cual ya no integridad de informacin

Bibliografa
Cristian Fabian Borghello. (12 de Octubre de 2009). Seguridad de
Informacion. Obtenido de http://www.seguinfo.com.ar/malware/keylogger.htm
Fishbones. (15 de Septiembre de 2015). KEYLOGGERS. Obtenido de
https://support.riotgames.com/hc/es/articles/204237320-KeyloggersQu%C3%A9-son-y-c%C3%B3mo-protegerse-de-ellos
Fiteni, L. E. (3 de Diciembre de 2012). queaprenderhoy. Obtenido de
http://queaprendemoshoy.com/seguridad-informatica-basica-que-esun-keylogger/

También podría gustarte