SQ(1)
๐ธ NAME ๐ธ
okay bestie, meet sq(1) โ from the User Commands section, it's a command-line frontend for Sequoia, which is an implementation of OpenPGP. Basically the CLI bestie for Sequoia energy. ๐
โจ SYNOPSIS โจ
Here's the whole command shape, and yes we're keeping every line:
sq encrypt [OPTIONS] FILE
sq decrypt [OPTIONS] FILE
sq sign [OPTIONS] FILE
sq verify [OPTIONS] FILE
sq download [OPTIONS]
sq inspect [OPTIONS] FILE
sq cert [OPTIONS] SUBCOMMAND
sq key [OPTIONS] SUBCOMMAND
sq pki [OPTIONS] SUBCOMMAND
sq network [OPTIONS] SUBCOMMAND
sq keyring [OPTIONS] SUBCOMMAND
sq packet [OPTIONS] SUBCOMMAND
sq config [OPTIONS] SUBCOMMAND
sq toc [OPTIONS]
sq version [OPTIONS]
๐ซ DESCRIPTION ๐ซ
Okay so functionality is grouped and available using subcommands. This interface is not completely stateless โ in particular, the user's default certificate store is used. You can disable that with --cert-store=none. Similarly, a key store is used to manage and protect secret key material, and you can disable that with --key-store=none. ๐ซถ
OpenPGP data can be provided in binary or ASCII armored form, and it's handled automatically. Emitted OpenPGP data is ASCII armored by default. โจ
Terminology check, iykyk: "certificate", or "cert" for short, means OpenPGP keys that do not contain secrets. Conversely, "key" means OpenPGP keys that do contain secrets. Periodt. ๐
๐ OPTIONS ๐
๐ Global options ๐
--batchโ Prevents any kind of prompting. It enables batch mode. In batch mode,sqwill never ask for user input, such as prompting for passwords. ๐--cert-store=PATHโ Specify the location of the certificate store. By default,squses the OpenPGP certificate directory in Sequoia's home directory (see--home),$HOME/.local/share/pgp.cert.d. This can be overridden by setting thePGP_CERT_Denvironment variable. Use'default'to explicitly use the default cert store, use'none'to not use a cert store. ๐--cli-version=CLI_VERSIONโ Select a CLI version.sq's CLI is versioned using a semantic versioning scheme. Setting this option causessqto error out if it does not implement an interface that is compatible with the specified version. For instance, if you set this to1.1.0andsqonly implements version1.0.0of the interface, thensqwill error out. ๐ค
sq may implement multiple interfaces (e.g., 1.1.4, and 2.0.5). By default, it selects the newest version. As such, if you require a particular interface, you need to set this option for every call to sq. ๐
bestie, this option must be the first option on the command line. no cap.
This version of sq implements version 1.5.0 of the CLI interface. Stable since 1.2.0. โญ
-h,--helpโ Print help (see a summary with '-h'). So--helpgives you the full help, and-his the summary vibe. ๐--home=PATHโ Set the home directory. Sequoia's default home directory is$HOME. When using the default location, files are placed according to the local standard, e.g., the XDG Base Directory Specification. When an alternate location is specified, the user data, configuration files, and cache data are placed under a single, unified directory. This is a lightweight way to partially isolatesq. Use'default'to explicitly use the default location, use'none'to not use a home directory. ๐--key-store=PATHโ Override the key store server and its data. A key store server manages and protects secret key material. By default,sqconnects to the key store server for Sequoia's default home directory (see--home),$HOME/.local/share/sequoia/keystore. If no key store server is running, one is started. ๐
This option causes sq to use an alternate key store server. If necessary, a key store server is started, and configured to look for its data in the specified location. Use 'default' to explicitly use the default server, use 'none' to not use a key store. ๐
--keyring=PATHโ Specify the location of a keyring to use. Keyrings are used in addition to any certificate store. The content of the keyring is not imported into the certificate store. When a certificate is looked up, it is looked up in all keyrings and any certificate store, and the results are merged together. ๐ฆ--known-notation=NOTATIONโ AddNOTATIONto the list of known notations. This is used when validating signatures. Signatures that have unknown notations with the critical bit set are considered invalid. โ ๏ธ--overwriteโ Overwrite existing files. Simple slay. ๐ฅ--password-file=FILEโ Seed the password cache with the specified password. The password is added to the password cache. When decrypting secret key material, the password cache is only used if the key is not protected by a retry counter, which automatically locks the key if a wrong password is entered too many times. ๐ญ
heads up: the entire key file will be used as the password, including any surrounding whitespace like a trailing newline. bestie, do not forget that newline. ๐
--policy-as-of=TIMEโ Select the cryptographic policy as of the specified time. The time is expressed as an ISO 8601 formatted timestamp. The policy determines what cryptographic constructs are allowed. ๐ฐ๏ธ
If you are working with a message that sq rejects, because it is protected by cryptographic constructs that are now considered broken, you can use this option to select a different cryptographic policy. If you are relying on the cryptography, e.g., you are verifying a signature, then you should only do this if you are confident that the message hasn't been tampered with. ๐จ
this is the "please let me look at old crypto" button; treat it with main-character caution. ๐
TIME is interpreted as an ISO 8601 timestamp. To set the policy time to January 1, 2007 at midnight UTC, you can do:
$ sq --policy-as-of 20070101 verify --message msg.pgp
Defaults to the reference time, which can be set using --time. โจ
-q,--quietโ Be more quiet. The default can be changed in the configuration file using the settingui.verbosity. ๐คซ--time=TIMEโ Set the reference time as an ISO 8601 formatted timestamp. Normally, commands use the current time as the reference time. This argument allows the user to use a different reference time. For instance, when creating a key usingsq key generate, the creation time is normally set to the current time, but can be overridden using this option. Similarly, when verifying a message, the message is verified with respect to the current time. This option allows the user to use a different time. โฐ
TIME is interpreted as an ISO 8601 timestamp. To set the certification time to July 21, 2013 at midnight UTC, you can do:
$ sq --time 20130721 verify --message msg.pgp
To include a time, say 5:50 AM, add a T, the time and optionally the timezone (the default timezone is UTC):
$ sq --time 20130721T0550+0200 --message verify msg.pgp
--trust-root=FINGERPRINT|KEYIDโ Consider the specified certificate to be a trust root. Trust roots are used by trust models, e.g., the Web of Trust, to authenticate certificates and User IDs. ๐-v,--verboseโ Be more verbose. The default can be changed in the configuration file using the settingui.verbosity. ๐ฃ๏ธ
โจ SUBCOMMANDS โจ
Okay so this is where the whole thing opens up like a group chat with fifty tabs โ each subcommand has its own main character energy. Bestie, let's go through them in order.
๐ sq encrypt ๐
sq encrypt encrypts a message. That's the whole gig. You can encrypt for any number of recipients and with any number of passwords, and you can optionally sign the message in the process. The converse operation is sq decrypt.
It respects the reference time set by the top-level --time argument. It uses that reference time when selecting encryption keys, and it sets the signature's creation time to the reference time. Slay.
๐ sq decrypt ๐
sq decrypt 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 the deets.
If certificates are supplied using the --signer-file 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, and the output file is deleted. If the output was sent to stdout, then the last 25 MiB of the message are withheld โ consequently, if the message is smaller than 25 MiB, no output is produced. That part is highkey important, no cap.
The converse operation is sq encrypt.
โ๏ธ sq sign โ๏ธ
sq sign signs messages or data files. It 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. Periodt.
๐ต๏ธ sq verify ๐ต๏ธ
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, and the output file is deleted. If the output was sent to stdout, then the last 25 MiB of the message are withheld โ consequently, if the message is smaller than 25 MiB, no output is produced.
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 clear text signatures, detached signatures or inline 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 download ๐
Download and authenticate the data.
This command downloads the data from the specified URL, checks the signature, and then authenticates the signer. If the signer cannot be authenticated, the data is deleted, if possible. The vibe check is strict here, bestie.
๐ sq inspect ๐
Inspect 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 ๐
Manage 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 ๐
Manage 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 cert for operations on certificates.
๐ซถ 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. Literally iconic.
๐ sq network ๐
Retrieve and publish 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 keyring ๐
Manage 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 packet ๐ง
Low-level packet manipulation.
An OpenPGP data stream consists of packets. These tools allow working with packet streams. They are mostly of interest to developers, but sq packet dump may be helpful to a wider audience both to provide valuable information in bug reports to OpenPGP-related software, and as a learning tool.
โ๏ธ sq config โ๏ธ
Query, inspect, and create the configuration file.
This subcommand can be used to query and inspect the configuration file (default location: $HOME/.config/sequoia/sq/config.toml), and to create a template that can be edited to your liking.
Configuration file: $HOME/.config/sequoia/sq/config.toml
๐ sq toc ๐
Recursively list all commands.
Recursively List all commands and show their short help.
๐ซ 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.
๐ธ ENVIRONMENT ๐ธ
These are the environment variables that can change how sq moves. Lowkey powerful, highkey useful.
๐ฆ SEQUOIA_CERT_STORE=PATH
Specify the location of the certificate store.
By default, sq uses the OpenPGP certificate directory in Sequoia's home directory (see --home), $HOME/.local/share/pgp.cert.d. This can be overridden by setting the PGP_CERT_D environment variable.
Use 'default' to explicitly use the default cert store, use 'none' to not use a cert store.
๐ SEQUOIA_HOME=PATH
Set the home directory.
Sequoia's default home directory is $HOME. When using the default location, files are placed according to the local standard, e.g., the XDG Base Directory Specification. When an alternate location is specified, the user data, configuration files, and cache data are placed under a single, unified directory. This is a lightweight way to partially isolate sq.
Use 'default' to explicitly use the default location, use 'none' to not use a home directory.
๐๏ธ SEQUOIA_KEY_STORE=PATH
Override the key store server and its data.
A key store server manages and protects secret key material. By default, sq connects to the key store server for Sequoia's default home directory (see --home), $HOME/.local/share/sequoia/keystore. If no key store server is running, one is started.
This option causes sq to use an alternate key store server. If necessary, a key store server is started, and configured to look for its data in the specified location.
Use 'default' to explicitly use the default server, use 'none' to not use a key store.
โจ EXAMPLES โจ
okay bestie, this is the part where it all clicks โ real commands, real vibes, zero guesswork ๐
๐ง sq encrypt
Encrypt a file for a recipient when you've got their fingerprint. iconic.
sq encrypt --for=EB28F26E2739A4870ECC47726F0073F60FD0CBF0 \
--signer-email=juliet@example.org document.txt
Encrypt a file for a recipient when you've got their email instead. no cap.
sq encrypt --for-email=alice@example.org \
--signer-email=juliet@example.org document.txt
๐ sq decrypt
Decrypt a file using a secret key. yes bestie, the secret key is doing the heavy lifting.
sq decrypt --recipient-file juliet-secret.pgp ciphertext.pgp
Decrypt a file and verify signatures while you're at it. multitasking queen behavior.
sq decrypt --recipient-file juliet-secret.pgp --signer-file \
romeo.pgp ciphertext.pgp
Decrypt a file using the key store. lowkey the easiest route.
sq decrypt ciphertext.pgp
โ๏ธ sq sign
Create a signed message. main character energy only.
sq sign --signer-file juliet-secret.pgp --message document.txt
Create a detached signature. it's giving separate-but-attached ๐
sq sign --signer-file juliet-secret.pgp \
--signature-file=document.txt.sig document.txt
๐ sq verify
Verify a signed message. trust issues? valid.
sq verify --message document.pgp
Verify a detached signature. yup, still slaying.
sq verify --signature-file=document.sig document.txt
Verify a message as of June 19, 2024 at midnight UTC. time travel but make it cryptographic โณ
sq verify --time 2024-06-19 --message document.pgp
โฌ๏ธ sq download
Download and verify the Debian 12 checksum file. Debian girlies rise up ๐
sq download --url=file://debian/SHA512SUMS \
--signature-url=file://debian/SHA512SUMS.sign \
--signer=DF9B9C49EAA9298432589D76DA87E80D6294BE9B \
--output=SHA512SUMS
๐ต๏ธ sq inspect
Inspect a certificate. look at her ๐
sq inspect juliet.pgp
Show how the certificate looked on July 21, 2013. vintage era, honestly.
sq inspect --time 20130721 juliet.pgp
Inspect an encrypted message. peek behind the curtain.
sq inspect message.pgp
Inspect a detached signature. small but mighty.
sq inspect document.sig
๐ SEE ALSO ๐
bestie, go read these next โ the whole squad is here:
sq-encrypt(1)sq-decrypt(1)sq-sign(1)sq-verify(1)sq-download(1)sq-inspect(1)sq-cert(1)sq-key(1)sq-pki(1)sq-network(1)sq-keyring(1)sq-packet(1)sq-config(1)sq-toc(1)sq-version(1)
For the full documentation see <https://book.sequoia-pgp.org/>. iykyk ๐
๐ VERSION ๐
1.5.0
that's the whole SQ(1) page, bestie โ brought to you by Sequoia PGP, version 1.5.0, page SQ(1) ๐
โจ
๐ฆ where this page comes from
- fedora 43: sequoia-sq 1.5.0-1.fc43 ยท LGPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND BSD-3-Clause AND MIT AND MPL-2.0 AND Unicode-3.0 AND Unicode-DFS-2016 AND Zlib AND bzip2-1.0.6 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
- fedora 44: sequoia-sq 1.5.0-1.fc44 ยท LGPL-2.0-or-later AND Apache-2.0 AND BSL-1.0 AND BSD-3-Clause AND MIT AND MPL-2.0 AND Unicode-3.0 AND Unicode-DFS-2016 AND Zlib AND bzip2-1.0.6 AND (0BSD OR MIT OR Apache-2.0) AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (BSD-2-Clause OR Apache-2.0 OR MIT) AND (MIT OR Apache-2.0 OR Zlib) AND (Unlicense OR MIT)
- opensuse-leap 16.0: sequoia-sq 1.5.0-bp160.1.1 ยท LGPL-2.0-or-later
- opensuse-leap 16.0: sequoia-sq 1.5.0-bp160.1.1 ยท LGPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms