# SecureRandom and digital signature

sandra guerra (sguerra@adria.it)
Sun, 05 Apr 1998 16:55:03 +0100

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: LDC - Pablo Teran: "signals help"
- Previous message: CyberMarketing@iname.com: "I thought you might be interested"

    Message-Id: <3.0.5.32.19980405165503.00904770@adria.it>

    Date: Sun, 05 Apr 1998 16:55:03 +0100

    To: java-security@web4.javasoft.com

    From: sandra guerra <sguerra@adria.it>

    Subject: SecureRandom and digital signature

I am an italian student (University of Venice, Computer Science) and i'm
realizing an electronic voting system in java (jdk 1.1.5) for my thesis.
In my project i need to use heavily SecureRandom generation but i've
noticed some strange behaviours.

This simple test loop

while(true)
{
System.out.println(new BigInteger(1024, new SecureRandom()));
}

blocks after n iterations without any apparent reason.
I've tested it under Win95 and WinNT (Pentium 75, 40 M RAM): under WinNT it
blocks a only little later.
If the loop is executed by n threads instead of a single process the block
is guaranteed.
I've read something somewhere about this in Internet.
Is it a bug? Or a "desired" behaviour when the machine in too loaded?

Id' like to know if some similar problems can arise too using digital
signatures (MD5/DSA) because my system blocks inexplicabily when more then
n threads (some n) are running using this digital signature code:

PrivateKey key;

byte[] digest= calcDigest; //calcDigest (MD5) snipped.
Signature sign = Signature.getInstance("DSA");
sign.initSign(key);
sign.update(digest);
byte[] signature= sign.sign(); <= BLOCKS HERE!!!!!!

Hoping in your help
And waiting..... :-)

Sandra Guerra

sguerra@adria.it
sguerra@dsi.unive.it

- Next message: LDC - Pablo Teran: "signals help"
- Previous message: CyberMarketing@iname.com: "I thought you might be interested"