TL;DR
You can’t directly decrypt a .gpg file using the Windows CNG store or ProtectedData API without additional software. .gpg files are encrypted using OpenGPG, which isn’t natively supported by Windows encryption tools. You’ll need Gpg4win (or similar) to handle decryption.
Understanding the Problem
Windows Certificate Store (CNG) and ProtectedData primarily work with certificates and data encrypted using algorithms like AES or RSA, often associated with X.509 certificates. .gpg files use OpenPGP, a different encryption standard. They rely on key pairs managed by GPG software.
Solution: Using Gpg4win
Gpg4win is a free and popular package for using OpenPGP in Windows. Here’s how to decrypt your .gpg file:
- Download and Install Gpg4win:
- Go to https://www.gpg4win.org/ and download the latest version.
- Run the installer. Accept the license agreements and choose a standard installation unless you have specific requirements.
- Import Your Private Key:
- You’ll need your private key to decrypt the file. This is usually in a .asc or similar format.
- Open Kleopatra (part of Gpg4win).
- Go to File → Import Certificates.
- Select your private key file and import it. You may be prompted for a passphrase if the key is protected.
- Decrypt the File:
- Right-click on the .gpg file in Windows Explorer.
- You should see an option like “Decrypt and Verify”. Select it.
- Kleopatra will use your imported private key to decrypt the file. It may ask for confirmation or a passphrase.
Alternative: Using Command Line (GnuPG)
If you prefer the command line, Gpg4win installs GnuPG which provides the gpg command.
- Open a Command Prompt or PowerShell:
- Search for “cmd” or “powershell” in the Windows Start menu.
- Decrypt using GnuPG:
- You will be prompted to enter the passphrase for your private key if it’s protected.
gpg --decrypt yourfile.gpg > outputfile.txt
Replace yourfile.gpg with the actual name of your .gpg file and outputfile.txt with the desired name for the decrypted file.
Why Windows CNG/ProtectedData Won’t Work Directly
Windows CNG and ProtectedData are designed for specific encryption scenarios, primarily those involving X.509 certificates and data protection APIs. They don’t inherently understand the OpenPGP format used by .gpg files.
Troubleshooting
- Missing Private Key: Ensure you’ve correctly imported your private key into Kleopatra.
- Incorrect Passphrase: Double-check that you are entering the correct passphrase for your private key.
- File Corruption: If the .gpg file is corrupted, decryption will fail. Try obtaining a fresh copy of the file if possible.

