{{Header}} {{Title|title= Verify {{project_name_long}} Virtual Machine Images in Windows }} {{#seo: |description=Instructions for OpenPGP Verification of {{project_name_short}} Images using Windows |image=Approved-29149640.png }} [[File:Approved-29149640.png|250px|thumbnail]] {{intro| Instructions for OpenPGP Verification of {{project_name_short}} Images using Windows }} = Context = {{always_verify_signatures_reminder}} = Usability = Due to [[Verifying_Software_Signatures#Conceptual_Challenges_in_Digital_Signatures_Verification|Conceptual Challenges in Digital Signatures Verification]] and [[Windows_Hosts#Windows_Software_Sources|impracticality, unpopularity of digital software signature verification on the Windows platform]], this is a cumbersome process. None of these issues are specific to {{project_name_short}} or caused by {{project_name_short}}. This is being stated to avoid {{project_name_short}} getting blamed for this mess. Previously users put it this way: {{quotation |quote=I never had to verify any software. Why Whonix makes this more complicated than everyone else? }} {{quotation |quote=To keep a system secure and free of malware it is strongly recommended to [[Warning#Always_Verify_Signatures|always verify software signatures]]. However, this is very difficult, if not impossible for Windows users. Most often, Windows programs do not have software signature files (OpenPGP / gpg signatures) that are normally provided by software engineers in the GNU/Linux world. }} Most other vendors of software on the Windows platform are either unaware or ignore this issue. The {{project_name_short}} project makes an effort to document and cope with the mess on the Windows platform. = Introduction = This page includes documentation on how to securely acquire Gpg4win – an application which can be used to verify digital software signatures provided by the {{project_name_short}} project and other software. Use either option A) or B). '''A)''' Using SignTool to verify Gpg4win: The following guide provides steps to: # Download and installation of SignTool. # Download Gpg4win. # Verify Gpg4win using SignTool. # Import the developer's GPG signing key into Gpg4win. # Verify the {{project_name_short}} Windows Installer using Gpg4win. SignTool is a Windows platform-focused tool provided by Microsoft which can be used to verify software digital signatures. [https://gnupg.org/ GnuPG] is a complete and free implementation of [[OpenPGP]] that allows users to encrypt and sign data and communications. It is popular on Windows, macOS, and Linux platforms. [https://www.gpg4win.org/ Gpg4win] is a graphical front end for GnuPG that is used for file and email encryption in Windows. The verification process for the {{project_name_short}} Windows Installer includes securely downloading and verifying the gpg4win package. Once completed, GPG can be used from the command-line to verify the {{project_name_short}} Windows Installer. Download and installation of SignTool (from the Microsoft website over TLS) and verification of Gpg4win using SignTool might be considered optional. This is because both SignTool and Gpg4win (downloaded from the Gpg4win website over TLS) are only downloaded over [[SSL|TLS]], a very basic form of authentication. The argument for this is debatable. "It would be much more unlikely for a massive company like Microsoft to be compromised and serve malicious software than gpg4win server." https://forums.whonix.org/t/testing-whonix-installer-for-windows/2987/217 Some browsers might use [[SSL#Key_Pinning|Key Pinning]] for microsoft.com but unfortunately for gpg4win.org, this would not be eligible. Therefore, optionally, the user might decide to skip the SignTool step and simplify as follows. '''B)''' Not using SignTool to verify Gpg4win: # Download and install Gpg4win. # Import the developer's GPG signing key into Gpg4win. # Verify the {{project_name_short}} Windows Installer using Gpg4win. The Gpg4win documentation also covers this subject. * [https://www.gpg4win.org/package-integrity.html Check integrity of Gpg4win packages – Gpg4win website] * [https://wiki.gnupg.org/Gpg4win/CheckIntegrity Check integrity of Gpg4win packages – Gpg4win wiki] = Verify {{project_name_short}} Images in Windows using Gpg4win = {{Download_and_Verify_GPG4win_in_Windows}} == Download the {{project_name_short}} Signing Key == {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = This entry is strongly related to the [[Trust|Placing Trust in {{project_name_short}}]] page. }} {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = This entry is for Download the {{project_name_short}} Signing Key on the Windows platform. Includes Windows specifics such as file paths. This chapter might be out of date. In case of questions, see the [[Signing Key|{{project_name_short}} Signing Key]] page first which takes presedence. }} Since all {{project_name_short}} releases are signed with the same key, it is unnecessary to verify the key every time a new release is announced. Trust in the key might gradually increase over time, but cryptographic signatures must still be verified every time a new release is downloaded. Note: With the exception of step 1 all commands should be run from C:\Users\ {{Box|text= '''1.''' If not already completed, have GnuPG initialize your user data folder. {{CodeSelect|code= gpg --fingerprint }} '''2.''' Download [[Patrick Schleizer]]'s (adrelanos') [[OpenPGP]] key. {{CodeSelect|code= curl --tlsv1.3 --proto =https --max-time 180 --output derivative.asc {{project_clearnet}}/keys/derivative.asc }}
{{Code2|'''{{signing_key_main}}'''}} Store the key as C:\Users\\Downloads\derivative.asc '''3.''' Change to the C:\Users\\Downloads\ directory. {{CodeSelect|code= cd C:\Users\\Downloads\ }} '''4.''' Check fingerprints/owners without importing anything. {{CodeSelect|code= gpg --keyid-format long --with-fingerprint derivative.asc }} '''5.''' Verify the output. The most important check is confirming the key fingerprint exactly matches the output below. Minor changes in the output such as new uids (email addresses) or newer expiration dates are inconsequential.
      Key fingerprint = 916B 8D99 C38E AF5E 8ADC  7A2A 8D66 066A 2EEA CCDA
The message gpg: key 8D66066A2EEACCDA: 104 signatures not checked due to missing keys is related to the [[OpenPGP#The_OpenPGP_Web_of_Trust|The OpenPGP Web of Trust]]. Advanced users can learn more about this [[Main/Project Signing Key#OpenPGP_Web_of_Trust|here]]. '''6.''' Import the key. {{CodeSelect|code= gpg --import derivative.asc }} The output should include the key was imported.
gpg: Total number processed: 1
gpg:               imported: 1
''If the {{project_name_short}} signing key was already imported in the past'', the output should include the key is unchanged.
gpg: Total number processed: 1
gpg:              unchanged: 1
If the following message appears at the end of the output.
gpg: no ultimately trusted keys found
This extra message does not relate to the {{project_name_short}} signing key itself, but instead usually means the user has not created an OpenPGP key yet, which is of no importance when verifying virtual machine images. Analyze the other messages as usual. }} == Verify the {{project_name_short}} Images == {{Box|text= Note: File extension, ova versus exe. These instructions often reference ova (VirtualBox image). The instructions are equally applicable to other file types such as exe (Whonix Windows Installer). The only difference is the file extension. '''1.''' If not already completed, download the Whonix image and the corresponding OpenGPG signature which will be used to verify the image. Choose either option A) or B) * '''A)''' Whonix for VirtualBox Windows Installer ova. Both, the signature and the .ova image should be downloaded into the same directory. Download the {{project_name_short}} VM image and signature from [[VirtualBox|VirtualBox Table]]. * '''B)''' Whonix Windows Installer exe. Both, the signature and the .exe image should be downloaded into the same directory. {{windows_installer_image_and_signature}} '''2.''' Start the cryptographic verification; this process can take several minutes. At the Windows command prompt, change to the directory with the Whonix.ova and corresponding signature file. {{CodeSelect|code= cd C:\Users\\ }} '''3.''' Verify the Whonix.ova image. {{CodeSelect|code= gpg --verify-options show-notations --verify Whonix*.*.asc Whonix*.* }} If the Virtual Machine image is correct the output will tell you that the signature is good. {{CodeSelect|code= gpg: Signature made Mon 19 Jan 2015 11:45:41 PM CET using RSA key ID 77BB3C48 gpg: Good signature from "Patrick Schleizer " [unknown] gpg: Signature notation: issuer-fpr@notations.openpgp.fifthhorseman.net=6E979B28A6F37C43BE30AFA1CB8D50BB77BB3C48 gpg: Signature notation: file@name={{project_name_short}}-{{VersionNew}}.ova 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: 916B 8D99 C38E AF5E 8ADC 7A2A 8D66 066A 2EEA CCDA Subkey fingerprint: 6E97 9B28 A6F3 7C43 BE30 AFA1 CB8D 50BB 77BB 3C48 }} This might be followed by a warning saying: {{Template:GnuPG-Warning}} {{gpg_signature_timestamp}} The first line includes the signature creation timestamp. Example.
gpg: Signature made Sun 18 Aug 2019 08:31:41 PM EDT
{{GnuPG_file_names}} To help users confirm that the file name has not been tampered with, beginning with {{project_name_short}} version 9.6 and above the {{Code2|file@name}} OpenPGP notation includes the file name. {{do_not_continue_on_gpg_verification_errors}} '''4.''' When {{project_name_short}} verification is complete, continue with the installation. }} = Troubleshooting = == SignTool is not Recognized == '''Figure:''' ''SignTool not Recognized Error'' [[File:signtool_command_not_recognized.png]] This error means the SignTool executable is not accessible through cmd.exe. A common cause for this error is SignTool was not installed in the user's [https://web.archive.org/web/20220707004040/https://john-dugan.com/path-variable-in-windows/?PageSpeed=noscript PATH]. To fix this issue add signtool.exe to your system PATH. https://www.godaddy.com/help/windows-cmd-signtool-is-not-recognized-as-an-internal-or-external-command-operable-program-or-batch-file-19987 Note: This solution is temporary and works only until the command prompt is closed. When the command prompt is restarted signtool.exe must be added to the system PATH again. {{Box|text= '''1.''' Open a command prompt. In the Windows Start menu, run. {{CodeSelect|code= cmd.exe }} '''2.''' Add the path to signtool.exe to your system PATH. The default installation path for signtool.exe:
x86 systems:  C:\Program Files (x86)\Windows Kits\\bin\x86
x64 systems:  C:\Program Files (x86)\Windows Kits\\bin\x64
Run the following command to add "path\to\signtool.exe" to your system PATH. Also be sure to add the Windows version to the path. {{CodeSelect|code= set PATH="path to signtool.ext";%PATH% }} For example, the following command adds the path for an x64 system. {{CodeSelect|code= set PATH="C:\Program Files (x86)\Windows Kits\\bin\x64";%PATH% }} }} == SignTool Certificate Chain Error == '''Figure:''' ''Root Certificate Error'' [[File:signtool_error_root_certificate_not_trusted.png]] This error message occurs if the /pa switch is not used with SignTool. This is because the default SignTool verify some_file.exe command uses the Windows Driver Verification Policy. See stackoverflow for further information: [https://stackoverflow.com/questions/11230091/whys-my-root-certificate-not-trusted Why's My Root Certificate Not Trusted?] In order for the file to verify properly the /pa switch must be used so SignTool uses the Default Authentication Verification Policy. == Encountering GPG Errors == When a GPG error is encountered, first try a web search for the relevant error. The [https://security.stackexchange.com security stackexchange website] can also help to resolve GPG problems. Describe the problem thoroughly, but be sure it is GPG-related and not specific to {{project_name_short}}. More help resources are available on the [[Support]] page. = Footnotes = {{reflist|close=1}} {{Footer}} [[Category:Documentation]]