Creates a new seed file suitable for use with
RNG_Initialize()
.
Public Declare Function RNG_MakeSeedFile Lib "diCrPKI.dll" (ByVal strSeedFile As String, ByVal strPrompt As String, ByVal nOptions As Long) As Long
nRet = RNG_MakeSeedFile(strSeedFile, strPrompt, nOptions)
long __stdcall RNG_MakeSeedFile(const char *szSeedFile, const char *szPrompt, long nOptions);
If successful, the return value is zero; otherwise it returns a nonzero error code.
static Rng.make_seedfile(seedfilename, strength=Strength.BITS_128, 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, PkiMkRngSeed.exe
, provided in the distribution
to make a new seed file [updated in v22.1].
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...", PKI_RNG_STRENGTH_128)
Debug.Print "RNG_MakeSeedFile('" & strSeedFile & "') returns " & nRet & " (expecting 0)"
RNG_Initialize RNG_UpdateSeedFile