{
    "mode": "man",
    "parameter": "OPENSSL-RAND",
    "section": "1SSL",
    "url": "https://www.chedong.com/phpMan.php/man/OPENSSL-RAND/1SSL/json",
    "generated": "2026-05-30T11:54:30Z",
    "synopsis": "openssl rand [-help] [-out file] [-base64] [-hex] [-engine id] [-rand files] [-writerand\nfile] [-provider name] [-provider-path path] [-propquery propq] num",
    "sections": {
        "NAME": {
            "content": "openssl-rand - generate pseudo-random bytes\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "openssl rand [-help] [-out file] [-base64] [-hex] [-engine id] [-rand files] [-writerand\nfile] [-provider name] [-provider-path path] [-propquery propq] num\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This 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",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-help",
                    "content": "Print out a usage message.\n"
                },
                {
                    "name": "-out",
                    "content": "Write to file instead of standard output.\n"
                },
                {
                    "name": "-base64",
                    "content": "Perform base64 encoding on the output.\n"
                },
                {
                    "name": "-hex",
                    "content": "Show the output as a hex string.\n"
                },
                {
                    "name": "-engine",
                    "content": "See \"Engine Options\" in openssl(1).  This option is deprecated.\n"
                },
                {
                    "name": "-rand -writerand",
                    "content": "See \"Random State Options\" in openssl(1) for details.\n"
                },
                {
                    "name": "-provider",
                    "content": ""
                },
                {
                    "name": "-provider-path",
                    "content": ""
                },
                {
                    "name": "-propquery",
                    "content": "See \"Provider Options\" in openssl(1), provider(7), and property(7).\n"
                }
            ]
        },
        "SEE ALSO": {
            "content": "openssl(1), RANDbytes(3), RAND(7), EVPRAND(7)\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "The -engine option was deprecated in OpenSSL 3.0.\n",
            "subsections": []
        },
        "COPYRIGHT": {
            "content": "Copyright 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)",
            "subsections": []
        }
    },
    "summary": "openssl-rand - generate pseudo-random bytes",
    "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"
        }
    ]
}