String Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > String commands > !STR.- String Command >

String Operations

STR.Chars C

Previous Top Next


MiniRobotLanguage (MRL)

 

STR.Chars C

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 recursion-with-carry generator, invented by George Marsaglia.  

Estimated Cycle length is 3 x 10^47.

This PRNG Passes All Test in ENT and in DIEHARD

ENT Can be found at: http://www.fourmilab.ch/random/

DIEHARD Can be found at: http://stat.fsu.edu/~geo/diehard.html    

 

The command itself looks like this:

STR.CHARS C|$$CNT|$$RES

 

And here is a small example:

 

: $$NUM=5

STR.CHARS C|$$NUM|$$RES

MBX.$$RES

 

This is a larger example which produces a Pad of size 50.

 

: $$CNT=50

STR.CHARS C|$$CNT|$$RES

LEN.$$RES|$$LEN

MBX.$$LEN->$$RES

ENR.

 

It brings up this output:

 

graphic

 

Use the CTF. - Copy-To-File to write it to a USB-Stick or Harddisk.

 

 

 

 

Syntax

 

STR.CHARS C|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 C

'*************************************

: $$CNT=50

STR.CHARS C|$$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.

 

graphic

 

 

 

Limitations:

 

-

 

 

See also:

 

    1.5.2 Working with Text-Strings

    STR.CHARS A

    STR.CHARS B

    STR.CHARS D

    CTF. - Copy-To-File

    STR.TEXT TO MIME

    STR.MIME TO TEXT

    GMD. - Get Message Digest

    SHA. - Safer Hash Algo

    GEC. - Get Encryption

    VAR. - Variable Set Value/Clear

    VAS. - Variable with String

    RPL. - RePLace in String

    IVS. / NVS. - If-Variable-String

    GSS. - GetSplitString

    GFS. - Get-Filtered-String

    GES. - Get-Extracted-String

    SBD. - String between Delimiter

    SBM. - String between Delimiter-Multiple

    FEM. - For Each Member

    LEN. - Length-of-String