Re: Is there any way...

Thomas Pornin (
Thu, 26 Feb 1998 11:10:26 +0100

In article <> you write:
>I need to generate some unique number or string
>based on real user ID of the process, so
>1. the number is independent of OS version
>2. reproducible
>3. other user ID would not be able to generate
> the same number even if he got a hold on
> a source code

A way could be the following: write a kernel module that contains a secret
key K and implements md5; this modules attaches itself to a device that
will return, when read or ioctled, the result of md5(getuid(),K). All you
need is to maintain the binary secret (that means chmod 600 on the .o);
the sources may be distributed freely. You may insert it anytime, with
kerneld for instance.

The /dev/random linux code uses md5, so you will easily find some code to

I see no way to do it without some secret key. After all, if there was no
secret, a user could reproduce the system on his own home-linux-PC.

--Thomas Pornin

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to