SQ(1)

πŸ’– SQ-PACKET β€” low-level packet manipulation, bestie edition πŸ’–

okay so this is the sq-packet page from the sq manual (that's the Sequoia PGP sq man page, section 1, user commands πŸ‘‘). it's the ✨low-level✨ packet manipulation corner of the toolset and we are going to get into it. buckle up πŸŽ€


🌸 NAME 🌸

sq-packet β€” low-level packet manipulation. yes literally that's the whole name. slay πŸ’…


✨ SYNOPSIS ✨

sq packet armor [OPTIONS] FILE
sq packet dearmor [OPTIONS] FILE
sq packet dump [OPTIONS] FILE
sq packet decrypt [OPTIONS] FILE
sq packet split [OPTIONS] FILE
sq packet join [OPTIONS] FILE

six subcommands, six little doors into the packet dimension πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

low-level packet manipulation. that's the vibe.

so here's the tea β˜•: an OpenPGP data stream is literally just packets. a pile of them. and this whole family of tools lets you work directly with those packet streams 🫢

ngl, most of these are aimed at developers (iykyk), BUT β€” sq packet dump is the one that's genuinely for a wider audience. it's giving "look inside the crypto blob and understand what's happening." it's great for putting real info into bug reports for OpenPGP-adjacent software, and it's also just a really good learning tool. main character energy for real 🌟


πŸ‘‘ SUBCOMMANDS πŸ‘‘

🌈 sq packet armor

convert binary to ASCII. the glow-up from unreadable bytes to transportable text πŸ’«

so, to make encrypted data easier to handle and transport, OpenPGP data can be transformed into an ASCII representation called ASCII Armor. sq already emits armored data by default, but this subcommand exists so you can take existing OpenPGP data and convert it to that ASCII-encoded representation.

the converse operation is sq packet dearmor. πŸ”

πŸ¦‹ sq packet dearmor

convert ASCII to binary. undoing the armor, revealing the raw little bytes underneath πŸ™ˆ

to make encrypted data easier to handle and transport, OpenPGP data can be transformed into an ASCII representation called ASCII Armor. sq transparently handles armored data on its own, but this subcommand lets you explicitly convert existing ASCII-encoded OpenPGP data into its binary representation.

the converse operation is sq packet armor. πŸ”

πŸ”₯ sq packet dump

list packets. this is the one, bestie, the star of the show ⭐

it creates a human-readable description of the packet sequence. on top of that, it can print cryptographic artifacts, and it can print the raw octet stream β€” like hexdump(1) but better, because it annotates specifically which bytes get parsed into which OpenPGP values. chef's kiss 😭

and if the packet stream includes an encryption container, sq will attempt to decrypt it. no cap.

πŸ’… sq packet decrypt

unwrap an encryption container 🎁

this decrypts a message and dumps the content of the encryption container without doing any further processing to it. the result is a valid OpenPGP message that you can β€” among other things β€” inspect with sq packet dump. iconic.

πŸ“ sq packet split

split a message into packets βœ‚οΈ

splitting a packet sequence into individual packets and then recombining them freely with sq packet join is a great way to experiment with OpenPGP data. genuinely so fun.

by default, the packets are written to stdout as a sequence of ASCII armored blocks. you can edit this file directly β€” e.g., moving, adding, or removing packets β€” and then use sq packet join to assemble the stream back together. it's giving arts and crafts 🎨

alternatively, if a --output-prefix is given, the packets get written into individual files starting with that prefix, and you can reassemble them with sq packet join.

the converse operation is sq packet join. πŸ”

🧚 sq packet join

join packets split across files 🧩

splitting a packet sequence into individual packets and recombining them freely with sq packet join is a great way to experiment with OpenPGP data. yes we said that in the last one, it's still true, it's the whole duo.

the converse operation is sq packet split. πŸ”


🌟 EXAMPLES 🌟

πŸ’« sq packet armor

convert a binary OpenPGP message to an ASCII armored OpenPGP message:

sq packet armor message.bin

convert a binary OpenPGP message to an ASCII armored OpenPGP message, explicitly choosing the armor label:

sq packet armor --label=message message.bin

πŸ¦‹ sq packet dearmor

convert an ASCII armored OpenPGP message to a binary OpenPGP message:

sq packet dearmor --output=message.bin message.pgp

πŸ”₯ sq packet dump

print the packets of a certificate:

sq packet dump juliet.pgp

print the packets including cryptographic artifacts of a certificate:

sq packet dump --mpis juliet.pgp

print the packets including a dump of every single byte of a certificate:

sq packet dump --hex juliet.pgp

print the packets of an encrypted message, decrypting it using a secret key file:

sq packet dump --recipient-file bob-secret.pgp message.pgp

🎁 sq packet decrypt

unwrap the encryption, revealing the signed message:

sq packet decrypt --recipient-file bob-secret.pgp message.pgp

βœ‚οΈ sq packet split

split a certificate into individual packets printed to stdout:

sq packet split --output=- juliet.pgp

split an inline-signed message into individual packets written to individual files with the prefix 'packet':

sq packet split --output-prefix packet document.pgp

then reassemble the message, transforming it into an old-style signed message with a prefix signature:

sq packet join --output prefix-signature.pgp --label message \
       packet-2-Signature-Packet packet-1-Literal-Data-Packet

🧩 sq packet join

split an inline-signed message into individual packets written to individual files with the prefix 'packet':

sq packet split --output-prefix packet document.pgp

then reassemble the message, transforming it into an old-style signed message with a prefix signature:

sq packet join --output prefix-signature.pgp --label message \
       packet-2-Signature-Packet packet-1-Literal-Data-Packet

πŸ’– SEE ALSO πŸ’–

for the full documentation go look at <https://book.sequoia-pgp.org/> 🌈


⭐ VERSION ⭐

1.5.0


and that's the whole page bestie, you made it 🫢 go dump some packets, no cap.

okay signing off: this was Sequoia PGP, version 1.5.0, from the sq man page (section 1, User Commands), with a date of 1.5.0 πŸ’œ mwah, bye!! πŸ’…βœ¨

πŸ“¦ where this page comes from