Web3S_Demo > Web 3S Crypto Function Library > Generate Bytes (CSPRNG)

Generate Bytes (CSPRNG)

Randomly generates the specified amount of bytes using a Cryptographically Secure Pseudo-Random Generator supplied by OpenSSL.

Note: By default, OpenSSL CSPRNG supports security level of 256 bits.
However, security depends on the entropy source.
For more information read https://www.openssl.org/docs/man1.1.1/man3/RAND_bytes.html.

Inputs

In
Exec

Num
Integer

the amount of bytes to generate.

Outputs

Out
Exec

Error Message
String

if an error occured, the error message.

Bytes
Array of Bytes

if generation was successful, the generated bytes.

Success
Boolean

True if generation was successful, false otherwise