From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30200 invoked by alias); 11 Apr 2006 04:21:14 -0000 Received: (qmail 30180 invoked by uid 48); 11 Apr 2006 04:21:13 -0000 Date: Tue, 11 Apr 2006 04:21:00 -0000 Message-ID: <20060411042113.30179.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug classpath/24481] SecureRandom.setSeed has no impact In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "csm at gnu dot org" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2006-q2/txt/msg00077.txt.bz2 List-Id: ------- Comment #5 from csm at gnu dot org 2006-04-11 04:21 ------- The original issue seems to be fixed; on gcj version `gcj (GCC) 4.2.0 20060410 (experimental)' I get this output from the `seed' testcase: > Byte difference in a seeded PRNG: 64 > Seed data: 9c1185a5c5e9fc5461288977ee8f548b2258d3138bbc57e4cbe8b6a1d2c999ef6253e0a6e58196ae643db8559e6ba7c97214bd66197b97184d68e3b0654b David, are you saying that if you have a program like: > import java.security.SecureRandom; > > class sr > { > public static void main (String[] argv) throws Throwable > { > SecureRandom sr = new SecureRandom (); > byte[] b = new byte[64]; > sr.nextBytes (b); > for (int i = 0; i < b.length; i++) > { > System.out.print (b[i]); > System.out.print (' '); > } > System.out.println (); > } > } ...that you get the same output every time? If so, this is because our default SecureRandom isn't seeded when created. Ideally, we would try to use `/dev/random,' or some timing data to get a random seed. -- csm at gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david at jpackage dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24481