table of contents
SQ(1) | User Commands | SQ(1) |
NAME¶
sq - A command-line frontend for Sequoia, an implementation of OpenPGP
SYNOPSIS¶
sq encrypt [OPTIONS] FILE
sq decrypt [OPTIONS] FILE
sq sign [OPTIONS] FILE
sq verify [OPTIONS] FILE
sq inspect [OPTIONS] FILE
sq cert [OPTIONS] SUBCOMMAND
sq key [OPTIONS] SUBCOMMAND
sq keyring [OPTIONS] SUBCOMMAND
sq pki [OPTIONS] SUBCOMMAND
sq autocrypt [OPTIONS] SUBCOMMAND
sq network [OPTIONS] SUBCOMMAND
sq toolbox [OPTIONS] SUBCOMMAND
sq version [OPTIONS]
DESCRIPTION¶
A command-line frontend for Sequoia, an implementation of OpenPGP.
Functionality is grouped and available using subcommands. This interface is not completely stateless. In particular, the user's default certificate store is used. This can be disabled using `--no-cert-store`.
OpenPGP data can be provided in binary or ASCII armored form. This will be handled automatically. Emitted OpenPGP data is ASCII armored by default.
We use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. Conversely, we use the term "key" to refer to OpenPGP keys that do contain secrets.
SUBCOMMANDS¶
sq encrypt¶
Encrypts a message.
Encrypts a message for any number of recipients and with any number of passwords, optionally signing the message in the process.
The converse operation is `sq decrypt`.
`sq encrypt` respects the reference time set by the top-level `--time` argument. It uses the reference time when selecting encryption keys, and it sets the signature's creation time to the reference time.
sq decrypt¶
Decrypts a message.
Decrypts a message using either supplied keys, or by prompting for a password. If message tampering is detected, an error is returned. See below for details.
If certificates are supplied using the `--signer-cert` option, any signatures that are found are checked using these certificates. Verification is only successful if there is no bad signature, and the number of successfully verified signatures reaches the threshold configured with the `--signatures` parameter.
If the signature verification fails, or if message tampering is detected, the program terminates with an exit status indicating failure. In addition to that, the last 25 MiB of the message are withheld, i.e. if the message is smaller than 25 MiB, no output is produced, and if it is larger, then the output will be truncated.
The converse operation is `sq encrypt`.
sq sign¶
Signs messages or data files.
Creates signed messages or detached signatures. Detached signatures are often used to sign software packages.
The converse operation is `sq verify`.
`sq sign` respects the reference time set by the top-level `--time` argument. When set, it uses the specified time instead of the current time, when determining what keys are valid, and it sets the signature's creation time to the reference time instead of the current time.
sq verify¶
Verifies signed messages or detached signatures.
When verifying signed messages, the message is written to stdout or the file given to `--output`.
When a detached message is verified, no output is produced. Detached signatures are often used to sign software packages.
Verification is only successful if there is no bad signature, and the number of successfully verified signatures reaches the threshold configured with the `--signatures` parameter. If the verification fails, the program terminates with an exit status indicating failure. In addition to that, the last 25 MiB of the message are withheld, i.e. if the message is smaller than 25 MiB, no output is produced, and if it is larger, then the output will be truncated.
A signature is considered to have been authenticated if the signer can be authenticated. If the signer is provided via `--signer-file`, then the signer is considered authenticated. Otherwise, the signer is looked up and authenticated using the Web of Trust. If at least one User ID can be fully authenticated, then the signature is considered to have been authenticated. If the signature includes a Signer User ID subpacket, then only that User ID is considered. Note: the User ID need not be self signed.
The converse operation is `sq sign`.
If you are looking for a standalone program to verify detached signatures, consider using sequoia-sqv.
`sq verify` respects the reference time set by the top-level `--time` argument. When set, it verifies the message as of the reference time instead of the current time.
sq inspect¶
Inspects data, like file(1).
It is often difficult to tell from cursory inspection using cat(1) or file(1) what kind of OpenPGP one is looking at. This subcommand inspects the data and provides a meaningful human-readable description of it.
`sq inspect` respects the reference time set by the top-level `--time` argument. It uses the reference time when determining what binding signatures are active.
sq cert¶
Manages certificates.
We use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. This subcommand provides primitives to generate and otherwise manipulate certs.
Conversely, we use the term "key" to refer to OpenPGP keys that do contain secrets. See `sq key` for operations on keys.
sq key¶
Manages keys.
We use the term "key" to refer to OpenPGP keys that do contain secrets. This subcommand provides primitives to generate and otherwise manipulate keys.
Conversely, we use the term "certificate", or "cert" for short, to refer to OpenPGP keys that do not contain secrets. See `sq keyring` for operations on certificates.
sq keyring¶
Manages collections of keys or certs.
Collections of keys or certificates (also known as "keyrings" when they contain secret key material, and "certrings" when they don't) are any number of concatenated certificates. This subcommand provides tools to list, split, merge, and filter keyrings.
Note: In the documentation of this subcommand, we sometimes use the terms keys and certs interchangeably.
sq pki¶
Authenticate certs using the Web of Trust.
The "Web of Trust" is a decentralized trust model popularized by PGP. It is a superset of X.509, which is a hierarchical trust model, and is the most popular trust model on the public internet today. As used on the public internet, however, X.509 relies on a handful of global certification authorities (CAs) who often undermine its security.
The Web of Trust is more nuanced than X.509. Using the Web of Trust, require multiple, independent paths to authenticate a binding by only partially trusting CAs. This prevents a single bad actor from compromising their security. And those who have stronger security requirements can use the Web of Trust in a completely decentralized manner where only the individuals they select – who are not necessarily institutions – act as trusted introducers.
sq autocrypt¶
Communicates certificates using Autocrypt.
Autocrypt is a standard for mail user agents to provide convenient end-to-end encryption of emails. This subcommand provides a limited way to produce and consume headers that are used by Autocrypt to communicate certificates between clients.
See <https://autocrypt.org/>.
sq network¶
Retrieves and publishes certificates over the network.
OpenPGP certificates can be discovered and updated from, and published on services accessible over the network. This is a collection of commands to interact with these services.
sq toolbox¶
Tools for developers, maintainers, and forensic specialists.
This is a collection of low-level tools to inspect and manipulate OpenPGP data structures.
sq version¶
Detailed version and output version information.
With no further options, this command lists the version of `sq`, the version of the underlying OpenPGP implementation `sequoia-openpgp`, and which cryptographic library is used.
This command can also be used to query the output format versions for the machine-readable output of various subcommands, and the default output format versions.
EXAMPLES¶
sq encrypt¶
Encrypt a file using a certificate
sq encrypt --recipient-file romeo.pgp message.txt
Encrypt a file creating a signature in the process
sq encrypt --recipient-file romeo.pgp --signer-file juliet.pgp \
message.txt
Encrypt a file using a password
sq encrypt --symmetric message.txt
sq decrypt¶
Decrypt a file using a secret key
sq decrypt --recipient-file juliet.pgp ciphertext.pgp
Decrypt a file verifying signatures
sq decrypt --recipient-file juliet.pgp --signer-file romeo.pgp \
ciphertext.pgp
Decrypt a file using a password
sq decrypt ciphertext.pgp
sq sign¶
Create a signed message
sq sign --signer-file juliet.pgp message.txt
Create a detached signature
sq sign --detached --signer-file juliet.pgp message.txt
Create a signature with the specified creation time
sq sign --time 20020304 --detached --signer-file juliet.pgp \
message.txt
sq verify¶
Verify a signed message
sq verify signed-message.pgp
Verify a detached message
sq verify --detached message.sig message.txt
Verify a message as of June 9, 2011 at midnight UTC:
sq verify --time 20130721 msg.pgp
sq inspect¶
Inspects a certificate
sq inspect juliet.pgp
Inspects a certificate ring
sq inspect certs.pgp
Inspects a message
sq inspect message.pgp
Inspects a detached signature
sq inspect message.sig
Show the certificate as it looked on July 21, 2013
sq inspect --time 20130721 cert.pgp
SEE ALSO¶
sq-encrypt(1), sq-decrypt(1), sq-sign(1), sq-verify(1), sq-inspect(1), sq-cert(1), sq-key(1), sq-keyring(1), sq-pki(1), sq-autocrypt(1), sq-network(1), sq-toolbox(1), sq-version(1).
For the full documentation see <https://book.sequoia-pgp.org>.
VERSION¶
0.33.0 (sequoia-openpgp 1.17.0)
0.33.0 | Sequoia-PGP |