sntrup(1)

πŸ“¦
version 0~20241021 Β· 3 versions
, in debian trixie, ubuntu questing

πŸ’– sntrup(1) β€” the manual, but make it make sense πŸ’–

okay bestie, sit down, hydrate, because we're talking about sntrup, the command-line interface for the libntruprime implementation of the Streamlined NTRU Prime cryptosystem. yes it's a whole mouthful. yes it's iconic. let's go 🫢


✨ SYNOPSIS ✨

Key generation (for, e.g., sntrup1277):

sntrup1277-keypair 5>publickey 9>secretkey

Encapsulation (for, e.g., sntrup1277):

sntrup1277-enc >ciphertext 7>sessionkey 4<publickey

Decapsulation (for, e.g., sntrup1277):

sntrup1277-dec 7>sessionkey <ciphertext 8<secretkey

🌸 DESCRIPTION 🌸

libntruprime is an implementation of the Streamlined NTRU Prime (https://ntruprime.cr.yp.to) cryptosystem. and the command-line interface for libntruprime gives you these little guys:

sntrup{653,761,857,953,1013,1277}-keypair
sntrup{653,761,857,953,1013,1277}-enc
sntrup{653,761,857,953,1013,1277}-dec

Each tool exits 0 on success, nonzero on failure. that's the whole vibe check β€” zero means slay, nonzero means something went sideways πŸ’€

These tools let libntruprime be easily used from shell scripts. Other languages can also use libntruprime via these tools, but ngl, languages typically have good support for FFI and can use the C interface directly. so if you're living in another language, you could shell out, but the C interface is right there being all convenient ✨

The details below use sntrup1277 as an example. just so we're all on the same page.


πŸ”‘ KEY GENERATION πŸ”‘

Alice runs the sntrup1277-keypair command. This command randomly generates Alice's secret key and Alice's corresponding public key. she's the main character, obviously πŸ‘‘

It writes the public key to file descriptor 5, and then writes the secret key to file descriptor 9. order matters, bestie β€” public first, then secret. no cap.


πŸ“¬ ENCAPSULATION πŸ“¬

Bob runs the sntrup1277-enc command. This command reads Alice's public key from file descriptor 4.

It randomly generates a ciphertext and the corresponding session key. then it writes the ciphertext to stdout, and then writes the session key to file descriptor 7. two outputs, two destinations, no confusion πŸ’…


πŸ”“ DECAPSULATION πŸ”“

Alice runs the sntrup1277-dec command. This command reads Alice's secret key from file descriptor 8, and then reads a ciphertext from stdin. secret key first, ciphertext second β€” the order is the moment πŸ™ˆ

It computes the corresponding session key, which it writes to file descriptor 7. and that's the whole loop, closed. periodt.


🌈 SEE ALSO 🌈


fr fr, keep your file descriptors straight β€” 4, 5, 7, 8, 9 are all doing very specific jobs and they are NOT interchangeable πŸŽ€

that's the tea, bestie πŸ’– this was sntrup(1) β€” section 1 of the manual, the command-line one, the one you actually run in your shell. go forth and encapsulate responsibly βœ¨πŸ¦‹

πŸ“¦ where this page comes from