|
Dimensione: 11037
Commento: Ultimo paragrafo md5 on linux
|
Dimensione: 11045
Commento:
|
| Le cancellazioni sono segnalate in questo modo. | Le aggiunte sono segnalate in questo modo. |
| Linea 115: | Linea 115: |
| Linea 134: | Linea 135: |
| = External Links = | = Collegamenti esterni = |
Introduzione
Il programma md5sum è progetto per verificare l'integrità dei dati usando l'hash crittografico a 128 bit MD5 (Message-Digest algorithm 5). Utilizzando in modo appropriato gli hash MD5 è possibile confermare sia l'integrità dei dati che l'autenticità.
In termini di integrità, un confronto di hash MD5 rileva nei file quelle differenze che potrebbero essere causa di errori. La possibilità che ci siano differenze è proporzionale alla dimensione del file; la possibilità di errori quindi incrementa tanto quanto più il file diventa grande. È consigliabile eseguire un confronto di hash MD5 quando si ha un file come il CD di installazione di un sistema operativo, che deve essere corretto al 100%.
In termini di sicurezza, gli hash crittografici come MD5 consentono l'autenticazione di dati ottenuti da mirror non sicuri. L'hash MD5 deve essere firmato o provenire da una sorgente sicura (una pagina HTTP) di un'organizzazione in cui si ripone fiducia. Consultare il file MD5SUMS per il rilascio che si sta usando presso http://releases.ubuntu.com (e opzionalmente le firme PGP nel file MD5SUMS.gpg), oppure fare riferimento alla pagina sicura UbuntuHashes per l'elenco ufficiale degli hash MD5 di Ubuntu.
Sebbene siano state scoperte delle falle di sicurezza nell'algoritmo MD5, gli hash MD5 risultano ancora utili qualora si abbia fiducia nell'organizzazione che li produce. È in discussione il passaggio ad hash più sicuri come SHA-256 and Whirlpool.
md5sum
#The official md5sum page for Ubuntu, Kubuntu, Edubuntu and Xubuntu is UbuntuHashes.
La pagina ms5sum per Ubuntu, Kubuntu, Edubuntu e Xubuntu è UbuntuHashes.
MD5SUM su Linux
La maggior parte delle distribuzioni Linux includono il programma di utilità md5sum, perciò di solito non è necessario installarlo. Qui di seguito è mostrato un esempio relativo al LiveCD di Ubuntu 8.10.
Per prima cosa spostarsi nella directory corretta per verificare un file iso scaricato:
cd directory_di_scaricamento
Quindi, una volta nella directory, eseguire il seguente comando:
md5sum ubuntu-8.10-desktop-i386.iso
Il programma md5sum dovrebbe stampare una singola riga dopo il calcolo dell'hash:
24ea1163ea6c9f5dae77de8c49ee7c03 ubuntu-8.10-desktop-i386.iso
Comparare l'hash (la stringa alfanumerica a sinistra) calcolato dal proprio computer con il corrispondente hash sulla pagina UbuntuHashes. Se gli hash corrispondono in modo esatto, allora il file scaricato è quasi certamente intatto. Se gli hash non corrispondono, allora si è verificato un problema nello scaricare o un problema con il server. In questo caso è necessario scaricare nuovamente il file, dallo stesso mirror oppure da un mirror differente se si sospetta un errore nel server. Qualora si riceva continuamente un file errato da un server, è opportuno e gradito segnalare tale problema al webmaster del mirror, in modo che si possa investigare.
Se l'hash MD5 corretto è contenuto in un file all'interno della stessa directory del file iso, con md5sum è possibile verificare l'hash in modo semi-automatico. Di solito è possibile trovare il file md5sum sulla stessa pagina da cui si è scaricato il file iso. Ubuntu distribuisce gli hash MD5 all'interno di un file dal nome "MD5SUMS".
md5sum -c MD5SUMS
MD5SUM su Mac OS X
Follow the instructions for MD5SUM on Linux, except use the command "md5" instead of "md5sum".
You can also find the MD5 hash using OS X's built in Disk Utility program. You can find it in the Utilities folder in Applications, or by choosing "Utilities" from the Finder's "Go" menu. Open Disk Utility and wait for it to gather information about your disks. Go to the directory where you downloaded the Ubuntu disk image, and drag it to Disk Utility's dock icon. For this example we'll be checking the Ubuntu 8.10 Desktop install CD. The disk image should show up on the left-hand side of Disk Utility, underneath your physical drives. Go to the "Images" menu and select Checksum > MD5. Be sure to choose "MD5" and NOT "MD5 image checksum", as they are not the same and will give you different results. Disk Utility will return, in this case, "Checksum of "ubuntu-8.10-desktop-i386.iso" completed. MD5 24ea1163ea6c9f5dae77de8c49ee7c03" Compare the MD5 Disk Utility gives you with the corresponding hash on the UbuntuHashes page. When both hashes match exactly then the downloaded file is almost certainly intact.
If the hashes do not match, then there was a problem with either the download or a problem with the server. You should download the file again from either the same mirror, or from a different mirror if you suspect a server error. If you continuously receive an erroneous file from a server, please be kind and notify the webmaster of that mirror so they can investigate the issue.
digest(1) on Solaris
Use the Solaris digest(1) command, specifying the md5 algorithm with the -a flag. For instance:
$ digest -a md5 ubuntu-8.10-desktop-i386.iso 24ea1163ea6c9f5dae77de8c49ee7c03
MD5SUM su Windows
Windows does not come with md5sum. You must download one from another location, preferably one that you trust. There are command line utilities (md5sum.exe) that work similarly to the Unix utility; one public domain version with source is available from Fourmilab, but the version available from Cygwin is probably easier to install and update, and Cygwin is also recommended and trusted as the source for many more Unixy utilities. Once installed, Cygwin's md5sum behaves exactly as described in MD5SUM on Linux above.
There are also graphical tools such as the one used in the walk-through provided below.
Download and install winMD5Sum, a free and open source hash verification program.
- Right-click the ISO file.
Click Send To, then winMD5Sum.
Wait for winMD5Sum to load and finish the checksum (this may take a significant amount of time depending on your computer's performance).
Copy the corresponding hash from UbuntuHashes into the bottom text box.
- Click "Compare"
- A message box will say "MD5 Check Sums are the same" if the hashes are equal.
MD5SUM on CD
To see if your Ubuntu CD was corrupted when burned to the disk, see the CDIntegrityCheck page, or follow the instructions below.
First mount the CD, if not already mounted:
sudo mount /dev/hda /cdrom
Then use the supplied md5sum file on the CD:
cd /cdrom md5sum -c md5sum.txt | grep -v 'OK$'
Be patient, it takes some time. If the command outputs any errors, you'll know that either the burn was bad or the .iso is corrupt. Please note that this method does not verify authenticity unless the hash of the iso file is compared to the hash at the secure UbuntuHashes page.
Finally, you can unmount the CD after leaving the folder:
cd / sudo umount /dev/hda
MD5SUM of burnt media
Depending on how you burn you ISOs you can check the burnt media directly. Start by checking that the ISO file is correct:
$ grep ubuntu-8.10-desktop-i386.iso MD5SUMS | tee /proc/self/fd/2 | md5sum --check - 24ea1163ea6c9f5dae77de8c49ee7c03 *ubuntu-8.10-desktop-i386.iso ubuntu-8.10-desktop-i386.iso: OK
Now burn it from Nautilus (right-click, "Write to Disc ..."). To check the media directly:
$ md5sum /dev/cdrom 24ea1163ea6c9f5dae77de8c49ee7c03 /dev/cdrom
where "/dev/cdrom" is typically a soft-link to your CD/DVD reader/burner. Note that the checksum matches.
