views:

365

answers:

3

When I run:

openssl genrsa -out mykey.key 2048

I get the following error:

unable to write 'random state'
    e is 65537 (0x10001)

My googling suggests this is some kind of Vista permissions issue. How can I allow Vista to write this file or how can I configure openssl to get round it?

A: 

I found this that might help: http://stackoverflow.com/questions/94445/using-openssl-what-does-unable-to-write-random-state-mean

also, here: http://adamyoung.net/OpenSSL-unable-to-write-random-state

there is a suggestion here http://www.mail-archive.com/[email protected]/msg51344.html on how to get it working in vista.

find the location of cmd.exe, right click and run as administrator

John Boker
It doesn't allow me to change the permissions for cmd.exe
Iain
I ran as administrator - didn't work.
Iain
A: 

add a HOME variable into your Environment Variables.

zengkun100
A: 

The root issue is that the RANDFILE variable in the OpenSSL configuration file is ignored on Windows. This has been a long-standing problem that continues to exist as of the OpenSSL v1.0a release, regardless of whether the target Windows platform is x86 or x64.

There is a delightfully simple solution, though. Merely use a regular environmental var to set the RANDFILE value, like

set RANDFILE=.rnd

Because this value is ephemeral, it must be re-issued for every new DOS box, or scripted in a batch file.

judoman