title: How to keep private keys in secured memory
body: <p>I have a private key that I decrypt using a password from the user, but I need to use this private key quite often, and I don't want to keep it decrypted in the memory.</p>
  
  <p>One option I thought of is encrypting the private key with a randomly generated one time password, and every time I use it, to replace the password, but still the one time password is kept in the memory.</p>
  
  <p>Another option I thought about is using OpenSSL memory BIO. From what I understood it keeps the data inside it secured (I have no idea how it does that, but that's what I've heard).</p>
  
  <p>What do you think is better? Are there any better options?
  Thanks! :-)</p>
  
  <p>p.s.
  I'm using native C++ and OpenSSL.</p>