title: Do the access levels and modifiers (private, sealed, etc) serve a security purpose in C#?
body: <p>I've seen that you can manipulate <a href="http://www.codeproject.com/KB/cs/testnonpublicmembers.aspx" rel="noreferrer">private and internal members using reflection</a>.  I've also seen it said that a <a href="http://www.allinterview.com/showanswers/4887.html" rel="noreferrer">'sealed' class is more secure that one that isn't</a>.</p>
  
  <p>Are the modifiers "public, protected, internal, private, abstract, sealed, readonly" anything more than a gentleman's agreement about design and API use, that can be broken as long as you have access to reflection? And if a hacker is already is running code that calls your API, the game is already lost, right?</p>
  
  <p>Is the following anymore secure than any other class?</p>
  
  <pre><code>//private class
  sealed class User
  {
      private string _secret = "shazam";
      public readonly decimal YourSalary;
      public string YourOffice{get;};
      private DoPrivilegedAction()
      {
      }
  }
  </code></pre>