(Likewise, you can supply the material to encrypt from stdin, terminated with an EOF, if you omit the input filename. Note that if you don't specify an output file (with the -o flag), GPG will spit out the product of the decryption on stdout. If you're looking for something to test your skills on, you can try decrypting this (ascii-armored, symmetric cipher). You will get a warning that the file was not integrity protected this is okay, and simply means the file was not digitally signed. This tells GPG to decrypt a file, put the output in filename, and find the input in filename.ascĪgain, change directory as appropriate so that the file (and gpg.exe under Windows) are accessible. To decrypt a file, use this command: gpg -d -o filename filename.asc For example, type cd "C:\Program Files\GNU\GnuPG", move your file to the same directory, and then type in the GPG command.
#Install gpg mac command line install
If you didn't add GPG to your path, you will need to be in the GPG install directory for this to work, and then either need to use the full path to the file in question, or move it to the GPG install directory for encryption. Under Windows, open Start > Programs > Accessories > Command Prompt. Change your current directory to that of the file you want to encrypt by typing " cd " (with a space after it), dragging the folder (or its icon from the window's title bar) containing the file into the Terminal window, then hitting return. Under MacOS X (and similarly for Unix/Linux), open Applications > Utilities > Terminal. This tells GPG to encrypt with a symmetric cipher, and will ascii-armor the result (not really necessary, but nice if you want to paste the result into an e-mail instead of attaching it, for example). To encrypt a file, use this command: gpg -armor -symmetric filename