Dois arquivos com o mesmo conteúdo, mas diferentes nomes de arquivo: ( arquivo1 e arquivo2 ):
cat file1
this is a simple file
cat file2
this is a simple file
md5sum file1
7de45bf879db49de7e2eacea23e6c165 file1
md5sum file2
7de45bf879db49de7e2eacea23e6c165 file2
Dois arquivos com conteúdo diferente, mas com os mesmos nomes de arquivo: ( arquivo1 e arquivo1 )
cat file1
this is a simple file
cat file1
this is a simple file with extra contents
md5sum file1 #first file1
7de45bf879db49de7e2eacea23e6c165 file1
md5sum file1 #second file1
c7c8f3fd9ddd7a926c31416a69063e4e file1
Na entrada wiki ,
However, it is very unlikely that any two non-identical files in the real world will have the same MD5 hash, unless they have been specifically created to have the same hash.
Mas o algoritmo MD5 tem suas próprias falhas.
However, now that it is easy to generate MD5 collisions, it is possible for the person who created the file to create a second file with the same checksum, so this technique cannot protect against some forms of malicious tampering. Also, in some cases, the checksum cannot be trusted (for example, if it was obtained over the same channel as the downloaded file), in which case MD5 can only provide error-checking functionality: it will recognize a corrupt or incomplete download, which becomes more likely when downloading larger files.
Eu recomendaria usar o sha1 para calcular a soma de verificação, já que a produção de colisões não é tão fácil ao usar sha1 . Produzir checksum sha1 é muito fácil, como você pode ver aqui .