title: Can Random.Next() be predicted from its outputs
body: <p>Having this (simplified) C# class:</p>
  
  <pre><code>public static class RandomValue
  {
      private static readonly Random s_random = new Random();
  
      public static int GetRandomValue()
      {
          lock (s_random)
          {
              return s_random.Next();
          }
      }
  }
  </code></pre>
  
  <p>Is it possible to predict the next value of <code>GetRandomValue()</code> by looking at the values generated by this method?</p>
  
  <p>Assumptions (for the sake of the question):</p>
  
  <ul>
  <li>The attacker does <em>not</em> know the seed (of course).</li>
  <li>The attacker can observe an unlimited number of subsequent results of <code>GetRandomValue()</code>.</li>
  </ul>
  
  <p>I'm asking because I've seen some code using a similar approach to generate some kind of access tokens. This code was not written by me and I would probably have used one of .NET's crypto random classes. I'm just curious whether this is still sufficiently secure.</p>