How to select a proper random seed?

Hi,
I am developing a filter driver by IFS kit.
Now i need to get (pseudo) random numbers.
RtlRandom(Ex) is good function, if a proper seed is chosen.

So I'd like to know a way to select proper random seed in kernel mode
in order to get unpredictable random numbers.

Satoru

A simple and common mechanism is to use the clock:

LARGE_INTEGER iSeed;
KeQuerySystemTime( &iSeed );
iRandom = RtlRandom( &iSeed.LowPart );

Ken

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@ybb.ne.jp
Sent: Wednesday, September 06, 2006 7:01 AM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] How to select a proper random seed?

Hi,
I am developing a filter driver by IFS kit.
Now i need to get (pseudo) random numbers.
RtlRandom(Ex) is good function, if a proper seed is chosen.

So I'd like to know a way to select proper random seed in kernel mode
in order to get unpredictable random numbers.

Satoru


Questions? First check the IFS FAQ at

You are currently subscribed to ntfsd as: xxxxx@comcast.net
To unsubscribe send a blank email to xxxxx@lists.osr.com

> So I’d like to know a way to select proper random seed in kernel mode

MD5 hash of system time (I think it was even used by NTLM protocol for
challenges)

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com