**Attention: These instructions are to verify the tor source code.**
**Please follow the right instructions to verify [Tor Browser's signature?](tbb/how-to-verify-signature/).**
Digital signature is a process ensuring that a certain package was generated by its developers and has not been tampered with.
Below we explain why it is important and how to verify that the [tor source code](https://www.torproject.org/download/tor/) you download is the one we have created and has not been modified by some attacker.
Each file on our [download page](https://www.torproject.org/download/source) is accompanied by a file labelled "sig" with the same name as the package and the extension ".asc".
These .asc files are OpenPGP signatures.
They allow you to verify the file you've downloaded is exactly the one that we intended you to get.
This will vary by web browser, but generally you can download this file by right-clicking the "sig" link and selecting the "save file as" option.
For example, `tor-0.4.6.7.tar.gz` is accompanied by `tor-0.4.6.7.tar.gz.asc`.
These are example file names and will not exactly match the file names that you download.
We now show how you can verify the downloaded file's digital signature on different operating systems.
Please notice that a signature is dated the moment the package has been signed.
Therefore every time a new file is uploaded a new signature is generated with a different date.
As long as you have verified the signature you should not worry that the reported date may vary.
### Installing GnuPG
First of all you need to have GnuPG installed before you can verify signatures.
#### For Windows users:
If you run Windows, [download Gpg4win](https://gpg4win.org/download.html) and run its installer.
In order to verify the signature you will need to type a few commands in windows command-line, `cmd.exe`.
#### For macOS users:
If you are using macOS, you can [install GPGTools](https://gpgtools.org).
In order to verify the signature you will need to type a few commands in the Terminal (under "Applications").
#### For GNU/Linux users:
If you are using GNU/Linux, then you probably already have GnuPG in your system, as most GNU/Linux distributions come with it preinstalled.
In order to verify the signature you will need to type a few commands in a terminal window.
How to do this will vary depending on your distribution.
### Fetching the Tor Developers key
Roger Dingledine (0xEB5A896A28988BF5 and 0xC218525819F78451), Nick Mathewson (0xFE43009C4607B1FB) sign Tor source tarballs.
This command results in the key being saved to a file found at the path `./tor.keyring`, i.e. in the current directory.
If `./tor.keyring` doesn't exist after running this command, something has gone wrong and you cannot continue until you've figured out why this didn't work.
### Verifying the signature
To verify the signature of the package you downloaded, you will need to download the corresponding ".asc" signature file as well as the installer file itself, and verify it with a command that asks GnuPG to verify the file that you downloaded.
The examples below assume that you downloaded these two files to your "Downloads" folder.
Note that these commands use example file names and yours will be different: you will have downloaded a different version than 9.0 and you may not have chosen the English (en-US) version.
The result of the command should produce something like this:
gpgv: Signature made Mon 16 Aug 2021 04:44:27 PM -03
gpgv: using RSA key 7A02B3521DC75C542BA015456AFEE6D49E92B601
gpgv: Good signature from "Nick Mathewson <nickm@torproject.org>"
If you get error messages containing 'No such file or directory', either something went wrong with one of the previous steps, or you forgot that these commands use example file names and yours will be a little different.
#### Workaround (using a public key)
If you encounter errors you cannot fix, feel free to [download and use this public key](https://openpgpkey.torproject.org/.well-known/openpgpkey/torproject.org/hu/kounek7zrdx745qydx6p59t9mqjpuhdf) instead. Alternatively, you may use the following command:
Nick Mathewson key is also available on [keys.openpgp.org](https://keys.openpgp.org/) and can be downloaded from [https://keys.openpgp.org/vks/v1/by-fingerprint/2133BC600AB133E1D826D173FE43009C4607B1FB](https://keys.openpgp.org/vks/v1/by-fingerprint/2133BC600AB133E1D826D173FE43009C4607B1FB).
If you're using macOS or GNU/Linux, the key can also be fetched by running the following command: