Vely logo install
examples
documentation

Vely 15.2.0 released on Jan 18, 2023
Articles updated Jan 17, 2023

random-crypto


Issues with this documentation page? Report here.

Purpose:


Obtain a random string for cryptographic use.

Syntax:



random-crypto to [ define ] <random string> \
    [ length <string length> ]


Description:


random-crypto obtains a random string of length <string length>. This statement uses a cryptographically secure pseudo random generator (CSPRNG) from OpenSSL library.  If "length" clause is omitted, the length is 20 by default. You can create <random string> with "define" clause. <random string> is allocated memory.

The value generated is always binary and may contain null-characters and is null-terminated.

Use this statement only when needed for specific cryptographic uses. In all other cases, use random-string which is 2-3 times faster.

Examples:


Get a 20-digit long random binary value:

random-crypto to define str length 20


See also:


Encryption ( decrypt-data   derive-key   encrypt-data   hash-string   random-crypto   random-string  )  SEE ALL (documentation)



Copyright (c) 2022 DaSoftver LLC. Vely is a trademark of Dasoftver LLC. The software and information herein are provided "AS IS" and without any warranties or guarantees of any kind. Vely elephant logo (c) 2022 DaSoftver LLC. This web page is licensed under CC-BY-SA-4.0.