Skip to main content

Encrypt file

Encrypt a file for one or more recipients' public keys, or with a passphrase only (symmetric), choosing the cipher and compression.

Command in the PGP toolkit · id ooa.pgp/encrypt · 10 inputs (1 required), 1 output

Inputs​

InputTypeRequiredDefaultWhat it is
PathFileYesFile to encrypt.
TargetFileNoEncrypted file to create; when empty, next to the file with .pgp added (.asc with armor), e.g. report.csv.pgp.
RecipientsAnyNoRecipient key ids, fingerprints or email addresses (text or List); may be empty when public_key_file is given.
ArmorBooleanNofalseASCII-armored output (text) instead of binary.
Gnupg homeFileNoSeparate key folder for this agent; the runner user's keyring when empty (GnuPG's, or the built-in one when GnuPG is not installed).
Public key fileFileNoRecipient's public key file (.asc or .gpg) to encrypt for, without importing it into a keyring first.
OverwriteBooleanNotrueReplace an existing target file.
CipherStringNodefaultSymmetric cipher for the data; default lets GnuPG choose from the recipients' key preferences (AES-128 for a passphrase). Older ciphers (CAST5, 3DES, BLOWFISH) only for old partners.
CompressionStringNodefaultCompression before encryption; none for files that are already compressed, such as .zip or .jpg.
PassphraseCredentialNoPassphrase that can decrypt the file. Alone it gives passphrase-only (symmetric) encryption; with recipients either the keys or the passphrase can decrypt.

Outputs​

OutputTypeWhat it is
targetFileFull path of the encrypted file.