Home 
username password  
Welcome, Guest.
Your IP: 100.28.231.85
2024-11-05 00:55:37 
 Public Support
 GetDSIFF.NewKeys wait infinitely
Bottom
 
Total posts: 3
 Author GetDSIFF.NewKeys wait infinitely
Chee Yang Chau

2018-04-24 10:04:11
Registered user
I run this code with previous version of StreamSec Tools works, but fail with recent version:

var lPrv: iDLPrivateKey;
    lPub: iDLPublicKey;
begin
  GetDSIFF.NewKeys(1024, 128, lPrv, lPub);
end;

The works wait infinitely and cause program to no response.  Any ideas?
Henrick Wibell Hellström

2018-04-24 11:23:22
Registered user
On POSIX platforms (OSX, iOS, Android, Linux), the random generator will now default to use /dev/random, which is the random bit stream that always returns fresh random bits, and hence waits in blocking mode for a fresh seed if depleted of randomness. One way to seed it is to provide the device with user input, such as key strokes, mouse movements, etc.

Also, on all platforms, if NIST Mode is enabled (default), the parameters will be checked for conformance with NIST guidelines. Using a prime modulus of 1024 bits and a group order of 128 bits is well below the currently approved minimum of 2048/224.

If you are using the FF key pair for other reasons than cryptographic security (such as access to internal legacy systems), you might disable NIST Mode by calling the public class procedure StreamSec.DSI.FFC.tDSIFF.DisableNISTMode during application start up.
Henrick Wibell Hellström

2018-04-24 11:59:51
Registered user
There is one other thing: The method StreamSec.DSI.Arith.tDSIRandom.DSIRawRandom will, with high probability, be called with a parameter that isn't initialized, but should be.

Add the ClearLong call as inserted below:


  lX := pDSIntegerData(GetDSIntData(aX));

  ClearLong(lX,aX.Size);
  fRawRandom.RawRandom(lX^,lSize*32);
Top

:: Written with and Powered by the RealThinClient SDK and StreamSec Tools 4.0::
Copyright (c) Danijel Tkalcec, StreamSec HB