{
    "content": [
        {
            "type": "text",
            "text": "# OPENSSL-RAND(1SSL) (man)\n\n**Summary:** openssl-rand - generate pseudo-random bytes\n\n**Synopsis:** openssl rand [-help] [-out file] [-base64] [-hex] [-engine id] [-rand files] [-writerand\nfile] [-provider name] [-provider-path path] [-propquery propq] num\n\n## Flags\n\n| Flag | Long | Arg | Description |\n|------|------|-----|-------------|\n| — | — | — | Print out a usage message. |\n| — | — | — | Write to file instead of standard output. |\n| — | — | — | Perform base64 encoding on the output. |\n| — | — | — | Show the output as a hex string. |\n| — | — | — | See \"Engine Options\" in openssl(1). This option is deprecated. |\n| — | — | — | See \"Random State Options\" in openssl(1) for details. |\n| — | — | — |  |\n| — | — | — |  |\n| — | — | — | See \"Provider Options\" in openssl(1), provider(7), and property(7). |\n\n## See Also\n\n- openssl(1)\n- RANDbytes(3)\n- RAND(7)\n- EVPRAND(7)\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **SYNOPSIS** (3 lines)\n- **DESCRIPTION** (8 lines)\n- **OPTIONS** (1 lines) — 9 subsections\n  - -help (2 lines)\n  - -out (2 lines)\n  - -base64 (2 lines)\n  - -hex (2 lines)\n  - -engine (2 lines)\n  - -rand -writerand (2 lines)\n  - -provider (1 lines)\n  - -provider-path (1 lines)\n  - -propquery (2 lines)\n- **SEE ALSO** (2 lines)\n- **HISTORY** (2 lines)\n- **COPYRIGHT** (9 lines)\n\n## Full Content\n\n### NAME\n\nopenssl-rand - generate pseudo-random bytes\n\n### SYNOPSIS\n\nopenssl rand [-help] [-out file] [-base64] [-hex] [-engine id] [-rand files] [-writerand\nfile] [-provider name] [-provider-path path] [-propquery propq] num\n\n### DESCRIPTION\n\nThis command generates num random bytes using a cryptographically secure pseudo random number\ngenerator (CSPRNG).\n\nThe random bytes are generated using the RANDbytes(3) function, which provides a security\nlevel of 256 bits, provided it managed to seed itself successfully from a trusted operating\nsystem entropy source.  Otherwise, the command will fail with a nonzero error code.  For more\ndetails, see RANDbytes(3), RAND(7), and EVPRAND(7).\n\n### OPTIONS\n\n#### -help\n\nPrint out a usage message.\n\n#### -out\n\nWrite to file instead of standard output.\n\n#### -base64\n\nPerform base64 encoding on the output.\n\n#### -hex\n\nShow the output as a hex string.\n\n#### -engine\n\nSee \"Engine Options\" in openssl(1).  This option is deprecated.\n\n#### -rand -writerand\n\nSee \"Random State Options\" in openssl(1) for details.\n\n#### -provider\n\n#### -provider-path\n\n#### -propquery\n\nSee \"Provider Options\" in openssl(1), provider(7), and property(7).\n\n### SEE ALSO\n\nopenssl(1), RANDbytes(3), RAND(7), EVPRAND(7)\n\n### HISTORY\n\nThe -engine option was deprecated in OpenSSL 3.0.\n\n### COPYRIGHT\n\nCopyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.\n\nLicensed under the Apache License 2.0 (the \"License\").  You may not use this file except in\ncompliance with the License.  You can obtain a copy in the file LICENSE in the source\ndistribution or at <https://www.openssl.org/source/license.html>.\n\n\n\n3.0.2                                        2026-04-07                           OPENSSL-RAND(1SSL)\n\n"
        }
    ],
    "structuredContent": {
        "command": "OPENSSL-RAND",
        "section": "1SSL",
        "mode": "man",
        "summary": "openssl-rand - generate pseudo-random bytes",
        "synopsis": "openssl rand [-help] [-out file] [-base64] [-hex] [-engine id] [-rand files] [-writerand\nfile] [-provider name] [-provider-path path] [-propquery propq] num",
        "flags": [
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Print out a usage message."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Write to file instead of standard output."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Perform base64 encoding on the output."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "Show the output as a hex string."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Engine Options\" in openssl(1). This option is deprecated."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Random State Options\" in openssl(1) for details."
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": ""
            },
            {
                "flag": "",
                "long": null,
                "arg": null,
                "description": "See \"Provider Options\" in openssl(1), provider(7), and property(7)."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "openssl",
                "section": "1",
                "url": "https://www.chedong.com/phpMan.php/man/openssl/1/json"
            },
            {
                "name": "RANDbytes",
                "section": "3",
                "url": "https://www.chedong.com/phpMan.php/man/RANDbytes/3/json"
            },
            {
                "name": "RAND",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/RAND/7/json"
            },
            {
                "name": "EVPRAND",
                "section": "7",
                "url": "https://www.chedong.com/phpMan.php/man/EVPRAND/7/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "-help",
                        "lines": 2
                    },
                    {
                        "name": "-out",
                        "lines": 2
                    },
                    {
                        "name": "-base64",
                        "lines": 2
                    },
                    {
                        "name": "-hex",
                        "lines": 2
                    },
                    {
                        "name": "-engine",
                        "lines": 2
                    },
                    {
                        "name": "-rand -writerand",
                        "lines": 2
                    },
                    {
                        "name": "-provider",
                        "lines": 1
                    },
                    {
                        "name": "-provider-path",
                        "lines": 1
                    },
                    {
                        "name": "-propquery",
                        "lines": 2
                    }
                ]
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "HISTORY",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 9,
                "subsections": []
            }
        ]
    }
}