<< Click to Display Table of Contents >> Navigation: 3. Script Language > String commands > !STR.- String Command > String Operations |
MiniRobotLanguage (MRL)
STR.Chars A
Generate a string with random Bytes
Intention
The used PRNG (Pseudo Random Number Generator) provides a source of cryptographically strong random 'bytes for use in creating session keys, One-TIme Pads and other similar purposes.
This CPRNG is based on the ANSI X9.17 standard for secure key generation and uses Rijndael as its cryptographic base algorithm.
A cryptographically strong PRNG produces values which are not predictable.
This quality separates such generators from other software random number
'generators, which always produce a predictable stream of values regardless
'of the size of a generator's period. If cryptographic strength is not
'required, a CPRNG constitutes overkill.
However, if cryptographic strength is in fact required, only a generator designed specifically for such use is acceptable.
The command itself looks like this:
STR.CHARS A|$$CNT|$$RES
And here is a small example:
: $$NUM=5
STR.CHARS A|$$NUM|$$RES
MBX.$$RES
This is a larger example which produces a Pad of size 50.
: $$CNT=50
STR.CHARS A|$$CNT|$$RES
LEN.$$RES|$$LEN
MBX.$$LEN->$$RES
ENR.
It brings up this output:
Use the CTF. - Copy-To-File to write it to a USB-Stick or Harddisk.
Syntax
STR.CHARS A|P1[|P2]
Parameter Explanation
P1 - length of desired random string in bytes. If omitted, a default length of 32 byte length is used.
P2 - destination variable, if omitted TOS will be used for the result.
Example
'*************************************
' STR.CHARS A
'*************************************
: $$CNT=50
STR.CHARS A|$$CNT|$$RES
LEN.$$RES|$$LEN
MBX.$$LEN->$$RES
ENR.
Remarks
While we have made any effort to produce PRNG's of highest quality, there is no absolute warranty whatever, that these randomly generated strings are safe for use with cryptographic or safety software, or even for password-generation on a specific computer-hardware. Therefore you have to use them on your own risk.
Below you can see the results of the so called "ENT-Test Suite" for OTP's generated with this PRNG.
Limitations:
-
See also:
• 1.5.2 Working with Text-Strings
• VAR. - Variable Set Value/Clear
• IVS. / NVS. - If-Variable-String
• SBD. - String between Delimiter
• SBM. - String between Delimiter-Multiple