Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7595261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:37:50+00:00 2026-05-30T21:37:50+00:00

From my reading of the standard, random_device::entropy() should return 0.0 if a software engine

  • 0

From my reading of the standard, random_device::entropy() should return 0.0 if a software engine is used. However, in VS2010 it returns 32.0, which in my understanding requires hardware to produce non-deterministic random numbers.

How does VS2010’s random_device generate the number sequence?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:37:51+00:00Added an answer on May 30, 2026 at 9:37 pm

    According to a comment left on this question by Hans Passant, random_device uses advapi32:SystemFunction036, which according to MSDN is an alias for RtlGenRandom. This is verified by the runtime library source provided with VC++ 2010:

    random_device::operator()() in <random> calls the following chain of functions:

    _Random_device() // in xrngdev.cpp
        rand_s()     // in rand_s.c
            RtlGenRandom()/SystemFunction036()  // in advapi32.dll
            
    

    According to a comment left by Michael Howard on one of his blog articles, "Cryptographically Secure Random number on Windows without using CryptoAPI", RtlGenRandom uses the following:

    The RNG generates as specified in FIPS 186-2 appendix 3.1 with SHA-1
    as the G function. With entropy from:

    • The current process ID (GetCurrentProcessID).

    • The current thread ID (GetCurrentThreadID).

    • The ticks since boot (GetTickCount).

    • The current time (GetLocalTime).

    • Various high-precision performance counters (QueryPerformanceCounter).

    • An MD4 hash of the user’s environment block, which includes username, computer name, and search path. MD4 is a hashing algorithm
      that creates a 128-bit message digest from input data to verify data
      integrity.

    • High-precision internal CPU counters, such as RDTSC, RDMSR, RDPMC

    • Low-level system information: Idle Process Time, Io Read Transfer Count, I/O Write Transfer Count, I/O Other Transfer Count, I/O Read
      Operation Count, I/O Write Operation Count, I/O Other Operation Count,
      Available Pages, Committed Pages, Commit Limit, Peak Commitment, Page
      Fault Count, Copy On Write Count, Transition Count, Cache Transition
      Count, Demand Zero Count, Page Read Count, Page Read I/O Count, Cache
      Read Count, Cache I/O Count, Dirty Pages Write Count, Dirty Write I/O
      Count, Mapped Pages Write Count, Mapped Write I/O Count, Paged Pool
      Pages, Non Paged Pool Pages, Paged Pool Allocated space, Paged Pool
      Free space, Non Paged Pool Allocated space, Non Paged Pool Free space,
      Free System page table entry, Resident System Code Page, Total System
      Driver Pages, Total System Code Pages, Non Paged Pool Lookaside Hits,
      Paged Pool Lookaside Hits, Available Paged Pool Pages, Resident System
      Cache Page, Resident Paged Pool Page, Resident System Driver Page,
      Cache manager Fast Read with No Wait, Cache manager Fast Read with
      Wait, Cache manager Fast Read Resource Missed, Cache manager Fast Read
      Not Possible, Cache manager Fast Memory Descriptor List Read with No
      Wait, Cache manager Fast Memory Descriptor List Read with Wait, Cache
      manager Fast Memory Descriptor List Read Resource Missed, Cache
      manager Fast Memory Descriptor List Read Not Possible, Cache manager
      Map Data with No Wait, Cache manager Map Data with Wait, Cache manager
      Map Data with No Wait Miss, Cache manager Map Data Wait Miss, Cache
      manager Pin-Mapped Data Count, Cache manager Pin-Read with No Wait,
      Cache manager Pin Read with Wait, Cache manager Pin-Read with No Wait
      Miss, Cache manager Pin-Read Wait Miss, Cache manager Copy-Read with
      No Wait, Cache manager Copy-Read with Wait, Cache manager Copy-Read
      with No Wait Miss, Cache manager Copy-Read with Wait Miss, Cache
      manager Memory Descriptor List Read with No Wait, Cache manager Memory
      Descriptor List Read with Wait, Cache manager Memory Descriptor List
      Read with No Wait Miss, Cache manager Memory Descriptor List Read with
      Wait Miss, Cache manager Read Ahead IOs, Cache manager Lazy-Write IOs,
      Cache manager Lazy-Write Pages, Cache manager Data Flushes, Cache
      manager Data Pages, Context Switches, First Level Translation buffer
      Fills, Second Level Translation buffer Fills, and System Calls.

    • System exception information consisting of Alignment Fix up Count, Exception Dispatch Count, Floating Emulation Count, and Byte Word
      Emulation Count.

    • System lookaside information consisting of Current Depth, Maximum Depth, Total Allocates, Allocate Misses, Total Frees, Free Misses,
      Type, Tag, and Size.

    • System interrupt information consisting of context switches, deferred procedure call count, deferred procedure call rate, time
      increment, deferred procedure call bypass count, and asynchronous
      procedure call bypass count.

    • System process information consisting of Next Entry Offset, Number Of Threads, Create Time, User Time, Kernel Time, Image Name, Base
      Priority, Unique Process ID, Inherited from Unique Process ID, Handle
      Count, Session ID, Page Directory Base, Peak Virtual Size, Virtual
      Size, Page Fault Count, Peak Working Set Size, Working Set Size, Quota
      Peak Paged Pool Usage, Quota Paged Pool Usage, Quota Peak Non Paged
      Pool Usage, Quota Non Paged Pool Usage, Page file Usage, Peak Page
      file Usage, Private Page Count, Read Operation Count, Write Operation
      Count, Other Operation Count, Read Transfer Count, Write Transfer
      Count, and Other Transfer Count.

    There’s a full explanation (including diagrams) in Chapter 8 of Writing Secure Code, 2nd Edition.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm reading from the standard input using the read() system call but there's a
In my simple custom shell I'm reading commands from the standard input and execute
From reading the Apple Docs on Core Data, I've learned that you should not
I'm receiving messages from a JMS MQ queue which are supposedly utf-8 encoded. However
Collation under the Unicode Technical Standard #10 (UCA), which is a separate thing from
What's the Scala recipe for reading line by line from the standard input ?
From reading here and around the net, I'm close to assuming the answer is
From reading the RFC it appears that CID can/must only contain characters from the
I find from reading perldoc perlvar, about a thousand lines in is help for
I know from reading Microsoft documentation that the "primary" use of the IDisposable interface

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.