OPENSSL-PRIME(1SSL)

✨ NAME ✨

okay so this is openssl-prime β€” it's a lil OpenSSL command that literally just computes prime numbers πŸ’… part of the OpenSSL fam, and yeah it's that same openssl prime you already know and love.


🌸 SYNOPSIS 🌸

openssl prime [-help] [-hex] [-in] [-generate] [-bits num] [-safe]
[-provider name] [-provider-path path] [-provparam [name:]key=value]
[-propquery propq] [-checks num] [number ...]

πŸ’– DESCRIPTION πŸ’–

so basically? this command checks if the numbers you hand it are prime. that's the whole vibe check. give it numbers, it tells you if they're prime. iconic.

and if you don't give it any numbers on the command line? then bestie you better use the -generate flag, because it's gonna generate primes for you instead β€” following whatever requirements the rest of the flags are specifying. no numbers + no -generate = nothing's happening, okay? 🫢


πŸŽ€ OPTIONS πŸŽ€

  • -help β€” shows you a summary of all the options. the little cheat sheet. slay.
  • -hex β€” turns on hex format, and it works both ways: output when you're generating a prime, and input when you're doing primality checking. hex girlies rise 🌈
  • -in β€” gives you file names that contain numbers, for primality checking. like, instead of typing the numbers, you point at a file. so convenient fr fr.
  • -generate β€” generate a prime number. that's it, that's the flag ✨
  • -bits num β€” generates a prime with num bits. so you pick how chunky it is πŸ’ͺ
  • -safe β€” okay so this one only does anything when you use it with -generate, and it generates a "safe" prime. and here's how you check that: if the number generated is n, then it also checks that "(n-1)/2" is prime too. both prime. double prime. no cap πŸ’€
  • -provider name
  • -provider-path path
  • -provparam [name:]key=value
  • -propquery propq

these four are all provider things β€” go read "Provider Options" in openssl(1), provider(7), and property(7). they said it better than I could, and I'm not about to make stuff up πŸ’…

  • -checks num β€” okay bestie don't get excited, this parameter is ignored. like, completely. it's giving vestigial. it's there, it does nothing, we move on πŸ¦‹
heads up: -checks num genuinely does nothing. don't be out here thinking you can crank up the checks. it is ignored. periodt.

Copyright 2017-2025 The OpenSSL Project Authors. All Rights Reserved.

Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.


and that's the whole page bestie 🌟 this was OpenSSL 4.0.3, dated 2026-09-29, straight from OPENSSL-PRIME(1SSL). go forth and compute primes responsibly πŸ§šπŸ’œ

πŸ“¦ where this page comes from