文件一致性校验(MD5,SHA1,GPG)
来源:互联网 发布:文件服务器 软件 编辑:程序博客网 时间:2024/06/05 22:40
一 为何要进行文件一致性校验?
为了确保你得到的文件是正确的版本,而没有被注入病毒和木马程序。例如我们经常在网上下载软件,而这些软件已经被注入了一些广告和病毒等,如果不进行文件与原始发布商的一致性校验的话,可能会给我们带来一定的损失。
二 文件一致性校验原理
要进行文件的一致性校验,我们不可能像文本文件比较那样,将两个文件放到一起对比,因为很多的时候文件很大。目前最理想的办法就是,是通过加密算法,对文件生成对应的值,通过生成的值与发布商提供的值比较来确认两个文件是否一致。
MD5和SHA1就是目前使用最为广泛的良种加密算法。这两种算法都是基于MD4,但又略有不同。一般来说,SHA1计算速度比较慢,但抗穷举行能也更好。
另外,SHA1是美国国家标准局颁布的标准加密算法。因此,在微软发布的Windows操作系统等光盘中,提供的就是sha1校验码。Google Code社区使用也是sha1验证码。
比较常用的还有GPG。
三 文件一致性校验工具
1) MD5+SHA1
* SUM, LINUX命令,用来获得文件的checksum和blocksize,常被用来检测文件是否被修改过。
* cksum, a Unix command that generates both a 32-bit CRC and a byte count for any given input file.
* md5sum, a Unix command that generates a MD5 sum (commonly used to verify .iso files)
* jdigest, a Java GUI tool that generates and checks MD5 and SHA sums
* Unix programs called md5/sha1 or md5sum/sha1sum are included in many unix distributions.
* sum is also available as part of GNU Textutils.
* md5, a command line utility usable on either Unix or MS-DOS/Windows, which generates and verifies message digests (digital signatures) using the MD5 algorithm. This program can be useful when developing shell scripts or Perl programs for software installation, file comparison, and detection of file corruption and tampering.
* 还有fsum
* HashCalc /super hash calc 一个超强的文件校验码计算工具!速度快,支持算法多,直接拖动即可计算,十分方便!还可对字串直接计算!
2) PGP
* The PGP signatures can be verified using PGP or GPG. First download the KEYS as well as the asc signature file for the particular distribution. Make sure you get these files from the main distribution directory, rather than from a mirror. Then verify the signatures using
% pgpk -a KEYS
% pgpv apache-ant-1.7.1-bin.tar.gz.asc
or
% pgp -ka KEYS
% pgp apache-ant-1.7.1-bin.tar.gz.asc
or
% gpg --import KEYS
% gpg --verify apache-ant-1.7.1-bin.tar.gz.asc
A command line version of GnuPG is also available for Windows users.
四 参考:
http://ant.apache.org/bindownload.cgi
http://www.fastsum.com/
http://fsumfe.sourceforge.net/
http://www.slavasoft.com/fsum
五 MD5创建和验证
1) 创建MD5验证码(fsum)
2)验证 (super hash calc)
完!
- 文件一致性校验(MD5,SHA1,GPG)
- 文件校验MD5、SHA1、CRC32、sha256、cksum
- 文件如何进行md5校验和sha1校验
- 2. 文件如何进行md5校验和sha1校验
- gpg校验文件
- gpg 校验文件
- MD5一致性校验
- Windows命令查看文件MD5,SHA1,SHA256 文件校验
- 如何计算文件MD5 sha1 -- 微软MD5/SHA1 校验工具 Microsoft File Checksum Integrity Verifier
- linux 系统文件校验方法--MD5,SHA1,PGP
- 命令行校验MD5 SHA1 等
- Linux计算md5sum(md5校验和) && 使用crypt和gpg加密/解密文件
- linux文件一致性校验
- CRC32、MD5、SHA1算法校验介绍
- CRC32、MD5、SHA1算法校验基本概念
- CRC32、MD5、SHA1算法校验介绍
- Linux系统中校验下载文件的完整性方法(MD5,SHA1,PGP)
- Linux系统中校验下载文件的完整性方法(MD5,SHA1,PGP)
- MapGuide 资源
- 批处理中使用vbs
- vbs实现unicode和ascii的转化
- dos和unix文本转化
- iptables 基本命令使用举例
- 文件一致性校验(MD5,SHA1,GPG)
- API控制VM虚拟机(VM Workstation or VM Server)
- python实例31[urllib.request.urlopen获取股票信息]
- grep sed awk实例练习
- python技巧31[对象相等性|dictionary模拟switchcase]
- python语法31[string的print和format]
- python资料
- python类库31[读写文件]
- python类库31[文件和目录os+os.path+shutil]