title: How to store SNMP-V3 credentials in a C# application
body: <p>i am creating a C# application (with .NET framework 4.6.1), which needs to communicate with an SNMP agent over SNMP-V3.</p>
  <p>I found myself baffling with the question of how should i store the SNMP credentials.
  i obviously cant hash them, because they are needed as plaintext when i'm initializing the SNMP manager, and i also don't want to force the user to enter them every time the application starts, because that could happen a few times per day.</p>
  <p>The application is to be deployed on several computers, on a closed network, so i can't access to any cloud services.</p>
  <p>I have come up with some techniques i can do this, and can't figure out which is the best for my use case:</p>
  <blockquote>
  <ol>
  <li>prompt the user for the credentials at the installation, or at the first launch of the app, encrypt it using Microsoft's DPAPI, and decrypt it whenever needed for SNMP communications</li>
  <li>Same as 1, but encrypt is using the user password (i have a login, and the login password is obviously hashed and salted).</li>
  <li>I have found <a href="https://github.com/AdysTech/CredentialManager" rel="nofollow noreferrer">this project</a> on github, which uses the Windows credentials manager- is this a valid option?</li>
  </ol>
  </blockquote>
  <p>To me 2 seems like the most robust way, but i then go into several problems, because i can have many users in the system and i would have to do this for every user, and i am not sure it has any advantages in a security point of view.</p>
  <p>The scenario i am supposed to face is one where i have an attacker inside the closed network, but if he has control over the machine running my app, it's game over right?
  and if that is the case, why even bother with securing the passwords at all?</p>
  <p>Any tips and enlightenment will be highly appreciated.</p>
  <p>Thanks.</p>