MODULI(5)
β¨ MODULI β bestie edition β¨
okay so this is the File Formats Manual page for MODULI(5), and it's literally about Diffie-Hellman moduli. yes really. stay with me, it's more fun than it sounds π
πΈ NAME πΈ
moduli β Diffie-Hellman moduli. that's it, that's the name, short and iconic π
π¦ DESCRIPTION π¦
the file /etc/gsissh/moduli is holding a whole collection of prime numbers and generators, and it exists so that sshd(8) can use them in the Diffie-Hellman Group Exchange key exchange method. it's giving backstage crew for your crypto, no cap πβ¨
new moduli can be generated with ssh-keygen(1) and it's a two-step process, because of course it is:
- an initial candidate generation pass, using
ssh-keygen -M generate, calculates numbers that are likely to be useful. lowkey just vibes-checking numbers at this stage. - a second primality testing pass, using
ssh-keygen -M screen, gives a high degree of assurance that the numbers are prime and are safe for use in Diffie-Hellman operations bysshd(8). this is the vibe check that actually matters fr fr.
and this moduli format? it's used as the output from each pass. both of them. periodt.
the file is made of newline-separated records, one per modulus, and each record has seven space-separated fields. seven! here's the whole lineup π«Ά
- timestamp β the time that the modulus was last processed, formatted as
YYYYMMDDHHMMSS. it's a little timestamp receipt bestie. - type β a decimal number specifying the internal structure of the prime modulus. supported types are:
0β unknown, not tested.2β "safe" prime;(p-1)/2is also prime.4β Sophie Germain;2p+1is also prime.
moduli candidates initially produced by ssh-keygen(1) are Sophie Germain primes (type 4). further primality testing with ssh-keygen(1) produces safe prime moduli (type 2) that are ready for use in sshd(8). other types are not used by OpenSSH, so don't come for them π
- tests β a decimal number indicating the type of primality tests that the number has been subjected to, represented as a bitmask of these values:
0x00β not tested.0x01β composite number β not prime.0x02β Sieve of Eratosthenes.0x04β probabilistic Miller-Rabin primality tests.
the ssh-keygen(1) moduli candidate generation uses the Sieve of Eratosthenes (flag 0x02). subsequent ssh-keygen(1) primality tests are Miller-Rabin tests (flag 0x04). those are the two flags doing all the work, iykyk π
- trials β a decimal number indicating the number of primality trials that have been performed on the modulus.
- size β a decimal number indicating the size of the prime in bits.
- generator β the recommended generator for use with this modulus (hexadecimal).
- modulus β the modulus itself in hexadecimal.
and here's the fun part, the actual β¨ plot β¨ β when performing Diffie-Hellman Group Exchange, sshd(8) first estimates the size of the modulus required to produce enough Diffie-Hellman output to sufficiently key the selected symmetric cipher. then sshd(8) randomly selects a modulus from /etc/gsissh/moduli that best meets the size requirement. so it's shopping in the moduli closet and picking the fit that matches π₯π
π SEE ALSO π
β STANDARDS β
M. Friedl, N. Provos, and W. Simpson, Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol, RFC 4419, March 2006.
π that's the whole page bestie, go forth and understand your moduli π
Debian Β· April 16, 2022 Β· MODULI(5) β mwah, love u, see u in the group chat π«Άπ
π¦ where this page comes from
- epel 10: gsi-openssh-server 9.9p1-7.el10_3 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- epel 9: gsi-openssh-server 9.9p1-4.el9 Β· BSD
- fedora 43: gsi-openssh-server 10.0p1-3.fc43 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND sprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 43: gsi-openssh-server 10.0p1-7.fc43 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 44: gsi-openssh-server 10.2p1-1.fc44 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND sprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- fedora 44: gsi-openssh-server 10.2p1-4.fc44 Β· BSD-3-Clause AND BSD-2-Clause AND ISC AND SSH-OpenSSH AND ssh-keyscan AND snprintf AND LicenseRef-Fedora-Public-Domain AND X11-distribute-modifications-variant
- Copyright (c) 2008 Damien Miller <djm@mindrot.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms