CryptoSys API Library Manual


Creates a new seed file suitable for use with RNG_Initialize.

VBA/VB6 Syntax

Public Declare Function RNG_MakeSeedFile Lib "diCryptoSys.dll" (ByVal strSeedFile As String, ByVal strPrompt As String, ByVal nOptions As Long) As Long

nRet = RNG_MakeSeedFile(strSeedFile, strPrompt, nOptions)

C/C++ Syntax

long __stdcall RNG_MakeSeedFile( const char *szSeedFile, const char *szPrompt, long nOptions);


[in] specifying the seed file to be created.
[in] specifying an (optional) prompt for the dialog. Specify an empty string ("") or NULL to use the default dialog.
[in] option flags:
API_DEFAULT (0) for default options
API_RNG_STRENGTH_112 to make user generate an estimated 112 bits of security (default)
API_RNG_STRENGTH_128 to make user generate an estimated 128 bits of security
API_RNG_STRENGTH_192 to make user generate an estimated 192 bits of security
API_RNG_STRENGTH_256 to make user generate an estimated 256 bits of security

Returns (VBA/C)

If successful, the return value is zero; otherwise it returns a non-zero error code.

.NET Equivalent

Rng.MakeSeedFile Method (String, Rng.Strength)
Rng.MakeSeedFile Method (String, String, Rng.Strength)

Python Equivalent

static Rng.make_seedfile(seedfilename, strength=Strength.BITS_112, prompt='')


This uses a dialog window and expects the user to type in random keystrokes. Such a GUI interface may not be appropriate in all circumstances. A new seed file is always created. Any existing file with the same name will be overwritten without warning. Alternatively, use the command-line program, ApiMkRngSeed.exe, provided in the distribution to make a new seed file [updated in v6.22].


Dim strSeedFile As String
Dim nRet As Long

strSeedFile = "seed.dat"
nRet = RNG_MakeSeedFile(strSeedFile, "Making a new seed file: hit random keys until done...", API_RNG_STRENGTH_128)
Debug.Print "RNG_MakeSeedFile('" & strSeedFile & "') returns " & nRet & " (expecting 0)"

See Also

RNG_Initialize RNG_UpdateSeedFile

[Contents] [Index]

[PREV: RNG_KeyHex...]   [Contents]   [Index]   
   [NEXT: RNG_NonceData...]

Copyright © 2001-24 D.I. Management Services Pty Ltd. All rights reserved. Generated 2024-01-07T07:42:00Z.