View:Verifying the integrity of downloaded files under Linux (MD5,SHA1,PGP)Http://blog.useasp.net/archive/2014/03/29/use-md5-sha1-or-pgp-to-check-downloaded-file-integrity-on-linux.aspxLinux is always difficult to learn, but sometimes, but found
Some people often ask, what is the difference between CRC, MD5, and sha1 when calculating a verification value? I hope the descriptions below will give you an understanding.
Similarities:
CRC, MD5, and sha1 are calculated to generate a
This is a creation in
Article, where the information may have evolved or changed.
1.BASE64 encoding
Package Main//This syntax introduces the ENCODING/BASE64 package and uses the name b64 instead of the default base64. This saves you a bit of space.
This is a creation in
Article, where the information may have evolved or changed.
1.BASE64 encoding
Package Main//This syntax introduces the ENCODING/BASE64 package and uses the name b64 instead of the default base64. This saves you a bit of space.
#coding: GBK#md5SHA1 file Check value calculation# How to use: python file . PY Validating FilesImport HashlibImport SysImport OSdefmd5_sum (filename): # Check Value Methodfd=open (filename, "RB") # Open FileFd.seek (0) # move the file hit tag to
When we upload and download files, it can easily lead to the lack of files, so how to solve this problem? Users usually check using the SHA1 value. Today small compilation teaches everybody how to examine the file the SHA1 value.
Detection
The encrypted string is described inCode. Check the code ~
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
//
Define a sha1 object
System. Security. cryptography. sha1 sha1
=
# Region encrypts the specified string in MD5 Mode
//************************************** *******************************//// Security. Encrypt () method//// The encrypt method encrypts a clean string into a hashed string////*********************
People who often download software under Linux must have a good habit of verifying the hash of the file to determine the integrity of the file or even security. When I configure the environment also happens to use, the author is a lubuntu machine. I'
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.