How to verify signatures for packages
What is a signature and why should I check it?
How do you know that the Tor program you have is really the one we made? Many Tor users have very real adversaries who might try to give them a fake version of Tor — and it doesn't matter how secure and anonymous Tor is if you're not running the real Tor.
An attacker could try a variety of attacks to get you to download a fake Tor. For example, he could trick you into thinking some other website is a great place to download Tor. That's why you should always download Tor from https://www.torproject.org/. The https part means there's encryption and authentication between your browser and the website, making it much harder for the attacker to modify your download. But it's not perfect. Some places in the world block the Tor website, making users try somewhere else. Large companies sometimes force employees to use a modified browser, so the company can listen in on all their browsing. We've even seen attackers who have the ability to trick your browser into thinking you're talking to the Tor website with https when you're not.
Some software sites list sha1 hashes alongside the software on their website, so users can verify that they downloaded the file without any errors. These "checksums" help you answer the question "Did I download this file correctly from whoever sent it to me?" They do a good job at making sure you didn't have any random errors in your download, but they don't help you figure out whether you were downloading it from the attacker. The better question to answer is: "Is this file that I just downloaded the file that Tor intended me to get?"
Each file on our download
page is accompanied by a file with the same name as the
package and the extension ".asc". These .asc files are GPG
signatures. They allow you to verify the file you've downloaded
is exactly the one that we intended you to get. For example,
tor-browser-
Windows
You need to have GnuPG installed before you can verify signatures. Download it from http://gpg4win.org/download.html.
Once it's installed, use GnuPG to import the key that signed your package. Since GnuPG for Windows is a command-line tool, you will need to use cmd.exe. Unless you edit your PATH environment variable, you will need to tell Windows the full path to the GnuPG program. If you installed GnuPG with the default values, the path should be something like this: C:\Program Files\Gnu\GnuPg\gpg.exe.
Erinn Clark signs the Tor Browser Bundles. Import her key (0x63FEE659) by starting cmd.exe and typing:
C:\Program Files\Gnu\GnuPg\gpg.exe --keyserver hkp://keys.gnupg.net --recv-keys 0x63FEE659
After importing the key, you can verify that the fingerprint is correct:
C:\Program Files\Gnu\GnuPg\gpg.exe --fingerprint 0x63FEE659
You should see:
pub 2048R/63FEE659 2003-10-16 Key fingerprint = 8738 A680 B84B 3031 A630 F2DB 416F 0610 63FE E659 uid Erinn Clark <erinn@torproject.org> uid Erinn Clark <erinn@debian.org> uid Erinn Clark <erinn@double-helix.org> sub 2048R/EB399FD7 2003-10-16
To verify the signature of the package you downloaded, you will need to download the ".asc" file as well. Assuming you downloaded the package and its signature to your Desktop, run:
C:\Program Files\Gnu\GnuPg\gpg.exe --verify C:\Users\Alice\Desktop\.asc C:\Users\Alice\Desktop\
The output should say "Good signature":
gpg: Signature made Wed 31 Aug 2011 06:37:01 PM EDT using RSA key ID 63FEE659 gpg: Good signature from "Erinn Clark <erinn@torproject.org>" gpg: aka "Erinn Clark <erinn@debian.org>" gpg: aka "Erinn Clark <erinn@double-helix.org>" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 8738 A680 B84B 3031 A630 F2DB 416F 0610 63FE E659
Notice that there is a warning because you haven't assigned a trust index to this person. This means that GnuPG verified that the key made that signature, but it's up to you to decide if that key really belongs to the developer. The best method is to meet the developer in person and exchange key fingerprints.
Mac OS X
You need to have GnuPG installed before you can verify signatures. You can install it from http://macgpg.sourceforge.net/.
Once it's installed, use GnuPG to import the key that signed your package. Erinn Clark signs the Tor Browser Bundles. Import her key (0x63FEE659) by starting the terminal (under "Applications") and typing:
gpg --keyserver hkp://keys.gnupg.net --recv-keys 0x63FEE659
After importing the key, you can verify that the fingerprint is correct:
gpg --fingerprint 0x63FEE659
You should see:
pub 2048R/63FEE659 2003-10-16 Key fingerprint = 8738 A680 B84B 3031 A630 F2DB 416F 0610 63FE E659 uid Erinn Clark <erinn@torproject.org> uid Erinn Clark <erinn@debian.org> uid Erinn Clark <erinn@double-helix.org> sub 2048R/EB399FD7 2003-10-16
To verify the signature of the package you downloaded, you will need to download the ".asc" file as well. Assuming you downloaded the package and its signature to your Desktop, run:
gpg --verify /Users/Alice/.asc /Users/Alice/
The output should say "Good signature":
gpg: Signature made Wed 31 Aug 2011 06:37:01 PM EDT using RSA key ID 63FEE659 gpg: Good signature from "Erinn Clark <erinn@torproject.org>" gpg: aka "Erinn Clark <erinn@debian.org>" gpg: aka "Erinn Clark <erinn@double-helix.org>" gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: 8738 A680 B84B 3031 A630 F2DB 416F 0610 63FE E659
Notice that there is a warning because you haven't assigned a trust index to this person. This means that GnuPG verified that the key made that signature, but it's up to you to decide if that key really belongs to the developer. The best method is to meet the developer in person and exchange key fingerprints.
Linux
For RPM-based distributions you can manually verify the signatures on the RPM packages by:
rpm -K filename.rpm
For Debian, you should read the instructions on importing these keys to apt.
If you wish to learn more about GPG, see http://www.gnupg.org/documentation/.