Question: gpg how to encrypt a file?
Answer: Turn a directory into a file. If you want to encrypt a directory, you will need to convert it to a file first. ...  Prepare GPG. You will need to create a private key with which you will encrypt your files. ...  Encrypt. To encrypt a file, type gpg -e -r USERNAME ~USERNAME/filename. ...  Decrypt. To decrypt the file, type.