info > rand(3)

πŸ”– NAME

asn1parse, ca, ciphers, cms, crl, crl2pkcs7, dgst, dhparam, dsa, dsaparam, ec, ecparam, enc, engine, errstr, gendsa, genpkey, genrsa, info, kdf, mac, nseq, ocsp, passwd, pkcs12, pkcs7, pkcs8, pkey, pkeyparam, pkeyutl, prime, rand, rehash, req, rsa, rsautl, s_client, s_server, s_time, sess_id, smime, speed, spkac, srp, storeutl, ts, verify, version, x509 – OpenSSL application commands

πŸš€ Quick Reference

Use CaseCommandDescription
πŸ”‘ Generate RSA keyopenssl genrsaGenerate an RSA private key
πŸ“œ Generate CSRopenssl reqPKCS#10 certificate request and certificate generation
πŸ–ŠοΈ Display/sign certificatesopenssl x509Certificate display and signing utility
πŸ”’ Compute digestsopenssl dgstMessage digest (hash) computation
πŸ” Encrypt/decrypt filesopenssl encSymmetric encryption/decryption
βœ… Verify certificatesopenssl verifyX.509 certificate verification
🌐 SSL/TLS clientopenssl s_clientGeneric SSL/TLS client
πŸ–§ SSL/TLS serveropenssl s_serverGeneric SSL/TLS server
πŸ“¦ PKCS#12 utilityopenssl pkcs12PKCS#12 file conversion and management
πŸ” List cipher suitesopenssl ciphersDisplay SSL/TLS cipher suite list

πŸ“‹ SYNOPSIS

openssl cmd -help | [-option | -option arg] ... [arg] ...

πŸ“ DESCRIPTION

Every cmd listed above is a (sub-)command of the openssl(1) application. It has its own detailed manual page at openssl-cmd(1). For example, to view the manual page for the openssl dgst command, type β€œman openssl-dgst”.

βš™οΈ OPTIONS

Among others, every subcommand has a help option.

πŸ”— SEE ALSO

openssl(1), openssl-asn1parse(1), openssl-ca(1), openssl-ciphers(1), openssl-cms(1), openssl-crl(1), openssl-crl2pkcs7(1), openssl-dgst(1), openssl-dhparam(1), openssl-dsa(1), openssl-dsaparam(1), openssl-ec(1), openssl-ecparam(1), openssl-enc(1), openssl-engine(1), openssl-errstr(1), openssl-gendsa(1), openssl-genpkey(1), openssl-genrsa(1), openssl-info(1), openssl-kdf(1), openssl-mac(1), openssl-nseq(1), openssl-ocsp(1), openssl-passwd(1), openssl-pkcs12(1), openssl-pkcs7(1), openssl-pkcs8(1), openssl-pkey(1), openssl-pkeyparam(1), openssl-pkeyutl(1), openssl-prime(1), openssl-rand(1), openssl-rehash(1), openssl-req(1), openssl-rsa(1), openssl-rsautl(1), openssl-s_client(1), openssl-s_server(1), openssl-s_time(1), openssl-sess_id(1), openssl-smime(1), openssl-speed(1), openssl-spkac(1), openssl-srp(1), openssl-storeutl(1), openssl-ts(1), openssl-verify(1), openssl-version(1), openssl-x509(1)

πŸ“œ HISTORY

Initially, the manual page entry for the β€œopenssl cmd” command used to be available at cmd(1). Later, the alias openssl-cmd(1) was introduced, which made it easier to group the openssl commands using the apropos(1) command or the shell’s tab completion.

In order to reduce cluttering of the global manual page namespace, the manual page entries without the β€˜openssl-’ prefix have been deprecated in OpenSSL 3.0 and will be removed in OpenSSL 4.0.

©️ COPYRIGHT

Copyright 2019-2020 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>.


πŸ”– NAME

RAND – the OpenSSL random generator

πŸš€ Quick Reference

Use CaseFunctionDescription
🎲 Obtain random bytesRAND_bytes()Generate cryptographically secure random bytes
πŸ”’ Private random bytesRAND_priv_bytes()Generate random bytes for secret values
🌱 Seed the generatorRAND_seed()Seed the random generator with custom entropy
βœ… Check statusRAND_status()Check if the random generator is seeded and ready

πŸ“ DESCRIPTION

Random numbers are a vital part of cryptography, they are needed to provide unpredictability for tasks like key generation, creating salts, and many more. Software-based generators must be seeded with external randomness before they can be used as a cryptographically-secure pseudo-random number generator (CSPRNG). The availability of common hardware with special instructions and modern operating systems, which may use items such as interrupt jitter and network packet timings, can be reasonable sources of seeding material.

OpenSSL comes with a default implementation of the RAND API which is based on the deterministic random bit generator (DRBG) model as described in [NIST SP 800-90A Rev. 1]. The default random generator will initialize automatically on first use and will be fully functional without having to be initialized (β€˜seeded’) explicitly. It seeds and reseeds itself automatically using trusted random sources provided by the operating system.

As a normal application developer, you do not have to worry about any details, just use RAND_bytes(3) to obtain random data. Having said that, there is one important rule to obey: Always check the error return value of RAND_bytes(3) and do not take randomness for granted. Although (re-)seeding is automatic, it can fail because no trusted random source is available or the trusted source(s) temporarily fail to provide sufficient random seed material. In this case the CSPRNG enters an error state and ceases to provide output, until it is able to recover from the error by reseeding itself. For more details on reseeding and error recovery, see EVP_RAND(7).

For values that should remain secret, you can use RAND_priv_bytes(3) instead. This method does not provide β€˜better’ randomness, it uses the same type of CSPRNG. The intention behind using a dedicated CSPRNG exclusively for private values is that none of its output should be visible to an attacker (e.g., used as salt value), in order to reveal as little information as possible about its internal state, and that a compromise of the β€œpublic” CSPRNG instance will not affect the secrecy of these private values.

In the rare case where the default implementation does not satisfy your special requirements, the default RAND internals can be replaced by your own EVP_RAND(3) objects.

Changing the default random generator should be necessary only in exceptional cases and is not recommended, unless you have a profound knowledge of cryptographic principles and understand the implications of your changes.

βš™οΈ DEFAULT SETUP

The default OpenSSL RAND method is based on the EVP_RAND deterministic random bit generator (DRBG) classes. A DRBG is a certain type of cryptographically-secure pseudo-random number generator (CSPRNG), which is described in [NIST SP 800-90A Rev. 1].

πŸ”— SEE ALSO

RAND_bytes(3), RAND_priv_bytes(3), EVP_RAND(3), RAND_get0_primary(3), EVP_RAND(7)

©️ COPYRIGHT

Copyright 2018-2021 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>.

rand(3)
πŸ”– NAME πŸš€ Quick Reference πŸ“‹ SYNOPSIS πŸ“ DESCRIPTION βš™οΈ OPTIONS πŸ”— SEE ALSO πŸ“œ HISTORY ©️ COPYRIGHT πŸ”– NAME πŸš€ Quick Reference πŸ“ DESCRIPTION βš™οΈ DEFAULT SETUP πŸ”— SEE ALSO ©️ COPYRIGHT

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-06 06:40 @216.73.216.192
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format

^_top_^