lunes, 10 de marzo de 2008

Probando RAM con MD5sum

Copio de un post de Guppi en Kriptopolis:

"El algoritmo MD5 es un algoritmo de reducion criptografico.

Basicamente sirve para firmar un mensaje, es decir, al algoritmo le pasamos un mensaje (da igual la longitud de este) y MD5 nos devuelve 128 bits que serian la firma del mensaje. Con cambiar un solo bit en el mensaje, el resultado de MD5 cambia totalmente.

Aqui tienes para que veas como funciona:
http://es.wikipedia.org/wiki/MD5"

O sea, la utilidad primaria del MD5 es probar si un archivo no ha cambiado, aunque sea en un solo bit. Esto se logra generando un "resumen" (digest) del texto o archivo que se supone único para ese texto, como el resumen es único sirve para "firmar" criptograficamente textos o archivos. Cada vez que pasemos MD5sum a un texto o archivo, si da el mismo resumen podemos estar seguros que no ha sido alterado ni un solo bit.

Esto tiene una aplicación muy interesante que permite detectar si la memoria RAM de un computador presenta problemas. Simplemente se toma un archivo cualquiera muy grande, por ejemplo una imagen ISO y se le hace MD5 unas 10 o 20 veces, el resultado tiene que ser siempre el mismo, si sale un solo resultado distinto entonces la memoria RAM està con problemas.

El MD5sum para windows pueden bajarlo aqui En Linux y Unix viene incluìdo en el sistema.

11 comentarios:

Rimsky dijo...

Hi, Tom.

I’m glad I decided to look into your page about Ubuntu. I decided to give it a try and need the MD5Sum algorithm to check the integrity of the .iso file I downloaded.

I’ve been running Unbuntu from the installation CD to give it try.

LD

Tomas Bradanovic dijo...

Hello Lucio

I assume you want md5sum for Windows, you can download it from http://etree.org/md5com.html
There are several places where to download for free look "md5sum windows donload"

In Linux md5sum is included in the OS. Anyway if you have 2 GB RAM or such I reccomend you install Linux in a virtual machine.

Rimsky dijo...

Hi, Tom.

I never used anything but Windows until now, but since I’m planning to go to South America and need to do banking transactions over the Internet, I’m trying to get something more secure than Windows. It seems that Obuntu is pretty good, so I’m trying to get into it. I downloaded the .iso file to burn the installation CD, and the site that had the instructions on how to deal with Ubuntu recommended that the .iso file should be checked with MD5 for integrity. I was having a little trouble finding the right version, and by chance, I found it on your blog when I was looking for general info on Ubuntu.

I burned the installation CD, and I’m running Ubuntu from it. I’m having trouble getting on the Internet because my ISP works with specific MAC addresses, so I need to install it on the hard drive to change it to the right one because the file for the MAC address can’t be edited on the CD.

What advantage do you see in running Linux on a virtual machine?

Tomas Bradanovic dijo...

If you are worried about security (trojans, pishing and such) probably is more simple to install a clean XP in a virtual machine and use it only for transfers and security related issues. Windows XP is as secure as Linux for desktop use provided you dont use email or download programs. A virtual box allow you keep a "clean box" inside your regular Windows.

The last Ubuntu version (you must always install the last) is the 7.10 "gutsy gibbon". You may have no problem with Internet or MAC Adress if you are using the same machine, because Linux uses the same LAN card and the same MAC, anyway in the upper corner running Ubuntu appear the network icon, click there to check the satte of connection. If all seems to be OK (no errors) and you have no connection, is a typical MAC problem, if you are connected trough a modem you may try with "clone MAC address" option, or ask your provider to register the aditional MAC.

To use linux in a virtual box has several advantages, specially for those of us who use mainly Windows apps, you may run Linux in a virtual box just as if where any other app, in a "window" no need of dual boot, partotion of hard disk and the GRUB mess (the start up manager), is far better for those who are not willing to sacrifice the normal Windows apps looking for the Linux equivalent.

Rimsky dijo...

Tom, the idea for me is not to use anything above Windows 2000. As a matter of fact, my favorite OS is Win98SE. I’ll see how far I get with a Linux system. If I retire, I won’t be needing many of the Windows based applications I use now. It will probably be most Internet and media for me after that. For now, I’ll have to leave this Linux project aside for a couple of weeks because I’m working on doing my income tax return, which in my case is kind of complicated.

BTW, I read that you don’t like to talk on the phone, but if you have a landline (home phone), I can call you in talk (in Spanish) about this stuff and the possibility of going to Arica.

Tomas Bradanovic dijo...

Ok Linux, you have to try it. There are lot of mythology around Linux, the best is to try and decide for yourself.

A couple of weeks for tax declaration! here in Chile it takes 5 minutes or so, the chilean Tax Service calculates a proposal for you online and if you agree just have to click OK, that`s all. This is the advantage of a simple tax structure.

Yea, I feel quite unconfortable talking by phone, but you can call me or mail me anytime, no problem, my land number is (56)(58)314191

Rimsky dijo...

What's the best time to call you?

edoherrera dijo...

La mejor manera de probar una memoria ram es utilizando el software memtest, hace distintas pruebas de memoria.
esta presente en varios cd de instalacion como gentoo y ubuntu.

Saludos

Tomas Bradanovic dijo...

Lucio, any hour is OK, I am at home most part of the day.

Eduardo, lo malo del memtest es que demora muchísimo, el MD5sum acusa un error en muy poco tiempo

Felipe Astroza dijo...

http://www.koders.com/c/fid3D64E21C0E09F5D6216C4E4B1BB933AA6C6A9EB4.aspx
Linea 312

y

http://www.netlib.org/crc/md5sum.c

En ambas implementaciones de md5sum se utiliza un buffer de a lo mas dos paginas de memoria (en general x86 usa paginas de 4K), lo unico que hace es leer un bloque del archivo y calcular su md5 basado en el contenido del bloque y el md5 del bloque anterior hasta que los bloques se acaben. En resumen, md5sum lee y escribe repetidamente en un buffer muy pequeño por lo que la efectividad de esta herramienta para detectar regiones anomalas es minima. No me cabe duda que te haya funcionado, pero no significa que sea recomendable. Hasta es mas efectivo abrir y guardar sucesivamente un archivo con Gimp

Tomas Bradanovic dijo...

Excelente observación Felipe, no había tomado en cuenta el tamaño del buffer y que hacía cálculo sucesivos por bloques, ¡Gracias!