| <--YBC |
Technical Documents and Other Useful Information
- md5sum, gpg, rpm --checksig
|
Last Update 03/07/06
|
|
Ways to test Authenticity and Integrity of a File or Program
I am currently looking for more resources on how the graphical software tools from Red Hat Linux and Mandrake Linux work to verify gpg signatures. Please send resources my way if you find them. 2. How md5sum (Message Digest) works 2.1 Using md5sum to verify a file Now you have your file and the md5sum number. An md5sum number might look something like this: 19971d632f73eb79694093fef7eaeffb. At the command line type in “md5sum <filename> like this: [root@sygny tmp]# md5sum gaim-0.74-1mdk.i586.rpm <enter> Check to make sure that both of the md5sum numbers are the same. If they are you have downloaded the file successfully without corruption. 3. How gnupg (GNU Privacy Guard) works Using gnupg can be easier in at least two ways. The first way is that the same private key can be used to digitally sign multiple files or programs. In fact a whole body of software can be digitally signed with one private key. Once you have the public key for that company you can use that one public key (along with a signature file if necessary) to verify all of the digitally signed files. You also can import and save the public key from the software source for future use. 3.1 Using gnupg to verify a file or program The signature file is only necessary when you are trying to verify the signature of a program. When individual files are signed the signature portion is part of the actual file itself. The public key can be in the form of a text file or it might be published on the web site you are visiting. A typical public key can look something like this: -----BEGIN PGP PUBLIC KEY BLOCK----- If this information is not already packaged in a neat small text file with a .sig or .asc extension, you'll want to copy the public gnupg key inside a basic text file. Then you can import this public key into your list of public keys. 3.2 Importing a public key [root@sygny tmp]# gpg --import <filename.asc> <enter> The above command will add the public key filename.asc to the gnupg keyring for future reference. The default keyring location will vary by Linux distribution. Usually the keyring file is located in a hidden directory in the user's home directory. In the instance above, the keyring file is created in the /root/.gnupg/pubring.gpg file. 3.3 Verifying a file [root@sygny tmp]# gpg --verify <filetoverify.doc> <enter> This will verify the signature embedded in the file using the public key that you have previously imported. The command will return a message stating that the verification had succeeded or failed. 3.4 Verifying a program [root@sygny tmp]# gpg --verify <signaturefile.sig> <filetoverify.zip>. In the above command notice the <signaturefile.sig> has been added. This command will return a message stating whether or not the file is verified. 4. What is this gpgv tool I've heard about? 5. How does “rpm --checksig” fit into the picture? The rpm command has options to it that will all you to import public keys and therefore verify files. The keys are stored in a different location than the gpg command does. To import a public key with the rpm command use the command: [root@sygny tmp]# rpm --import <keyfile> The public keys are all typically stored in the /var/lib/rpm/Pubkeys file in both Mandrake and Red Hat Linux. First you would import the public keyring and then use the following command to verify the signature on the file: [root@sygny tmp]# rpm --checksig GConf-1.0.9-13.1.92mdk.i586.rpm <enter> The “OK” above, confirms that both the md5sum and the gpg signature are valid. How does the rpm command know that the md5sum mark is correct? A md5sum marker is located within the actual rpm install file, and a md5sum marker is calculated by the rpm command. The two md5sum marks are then compared for verification. 6. Using software install tools like mcc (Mandrake Linux) or up2date (Red Hat Linux) The Red Had Linux up2date tool will verify the gpg signatures on the file or program and will give an error if the signature is missing or not valid. Mandrake Linux also includes the ability to check gpg signatures when installing or updating programs. 7. Other Resources Mailing Lists: |
|
|
|
Problems with this site? Contact the
webmaster
|