% gpg --output test.out -d test.gpg . This command may be combined with --encrypt (to sign and encrypt a message), --symmetric (to sign and symmetrically encrypt a message), or both --encrypt and --symmetric (to sign and encrypt a message that can be decrypted using a secret key or a passphrase). How Do I Send Encrypted Email? - Ask Leo! Passing a passphrase works fine if GPG is initalized without use_agent=True. Well, the problem is to put in the shell the passphrase. shows the homedir, or use. Question is, when encrypting, it asks for a passphrase, but when decrypting, it DOESN'T ask for a passphrase. If you are just encrypting, your private key is not needed, so it doesn't make sense to need to unlock it. The following are a list of commonly used commands for encrypting documents in Terminal (Mac, Linux) or PowerShell (Windows). The following GPG command will help us to import the " private.key " of the " john " to the Secret keyring of the " newuser ": $ gpg --import private.key. The way I automated this in SSIS was as follows: Trying to encrypt files using gpg (GnuPG) from command line, using AES256. Note that this passphrase is only used if the option --batch has also been given. Generally, it is run using Window's Command Prompt. So far so good. Decrypt and encrypt a file using gpg without re-typing the passphrase We can also directly encrypt a file . Encode a message with the option -decrypt with this file. This method will ask you to enter a passphrase which you will give to your receiver in order to decrypt the file $ gpg -c file_sym Decrypt a symmetric encryption You can create a key without a passphrase (not recommended), or most operating systems allow you to unlock the key for a certain period of time, or even from login. gnupg - gpg2 --symmetric and passphrase - Information Security Stack ... 4.1.2 Commands to select the type of operation--sign-s. Sign a message. After typing out that passphrase, click on the " OK " button: It Should Be Hard to Guess. C:\Program Files (x86)\GNU\GnuPG\gpg2.exe. Syntax: gpg --decrypt file $ gpg --decrypt test-file.asc You need a passphrase to unlock the secret key for user: "ramesh (testing demo key) " 2048-bit ELG-E key, ID 35C5BCDB, created 2010 .