Menu

#2 Patch for better RNG with MSVC

open
nobody
None
5
2006-07-13
2006-07-13
StarWarsFan
No

Hi there!

This patch modifies the rng functionality on usage with
MSVC. Now the method "CryptGenRandom" is used for the
random numbers such as the generated keys and so on.

The patch is based on version 1.8 of rand_source.c. In
the attached file you find a diff and the full source
of rand_source.c

Hints and notes to this version are welcome, so please
let me know if you got suggestions. Thx

Yours
Yves

Discussion

  • StarWarsFan

    StarWarsFan - 2006-07-13

    Logged In: YES
    user_id=1483001

    Sorry, forgot the attachement...

     
  • StarWarsFan

    StarWarsFan - 2006-07-13

    Logged In: YES
    user_id=1483001

    Another sorry, I forgot the changes for MSVC V7+ (2003). But
    now it should be right.

    Yours
    Yves

     
  • StarWarsFan

    StarWarsFan - 2006-07-13

    rand_source.c for MSVC with CryptGenRandom

     
  • Nobody/Anonymous

    The existing code uses rand_s on Visual Studio 2005 or later. Since 2005 has just been end-of-life'd -- the oldest compiler still available from Microsoft is Visual Studio 2008 -- I don't know if it's still necessary to add code that's only used on exactly one major release of Visual Studio (.NET, from 2002/2003).

     
  • Jonathan Lennox

    Jonathan Lennox - 2010-06-01

    Sorry, last comment was me (wasn't logged in).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.