Verifying the MD5 Checksum

2013-03-20

从互联网下载文件时,提供方经常会附上一个MD5或者sha1哈希值,方便下载用户校验下载文件的完整性。如果你下载了不完整的文件,哈希值肯定是不匹配的,那怎么校验哈希值呢?我们以mysql官方提供的文件和md5为例:

After you have downloaded a MySQL package, you should make sure that its MD5 checksum matches the one provided on the MySQL download pages. Each package has an individual checksum that you can verify against the package that you downloaded. The correct MD5 checksum is listed on the downloads page for each MySQL product, and you will compare it against the MD5 checksum of the file (product) that you download.

Each operating system and setup offers its own version of tools for checking the MD5 checksum.
1.md5sum
2.md5.exe
3.openssl md5

wget http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz
MD5: 9dcee911fb4bc7e977a6b63f4d3ffa63

Shell# md5sum mysql-5.6.10.tar.gz
9dcee911fb4bc7e977a6b63f4d3ffa63 mysql-5.6.10.tar.gz
Shell# openssl md5 mysql-5.6.10.tar.gz
MD5(mysql-5.6.10.tar.gz)= 9dcee911fb4bc7e977a6b63f4d3ffa63
Shell# openssl sha1 mysql-5.6.10.tar.gz
SHA1(mysql-5.6.10.tar.gz)= f37979eafc241a0ebeac9548cb3f4113074271b7

参考网址:
http://dev.mysql.com/doc/refman/5.6/en/verifying-md5-checksum.html

分类:Linux安全操作系统 | 标签: |

相关日志

评论被关闭!