title: .NET 4.5: Simple option to encrypt a string using logged-in user and machine as encryption key
body: <p>Using C# and .NET 4.5:</p>
  
  <p>I am looking for a simple and efficient option to use the windows user and current machine to encrypt/decrypt a string.</p>
  
  <p>The encrypted string can be decrypted on the very same machine with the same logged-in user only.</p>
  
  <p>Other users logged-in to the same machine must not be able to decrypt.
  The same user logged into another machine must not be able to decrypt.</p>
  
  <p>Back in 2002, I used to use DPAPI to do the similar thing. I expect there is a more modern option in 2016 with .NET 4.5 with single line of API call :) </p>
  
  <p>Update 1:</p>
  
  <p>Based on @Jeroen Mostert response, I understand that DPAPI wrapper class ProtectedData is still relevant. </p>
  
  <p>My question is which one of the following statements is correct in regards to DPAPI? I hope the correct answer is C since that is what I am looking for.</p>
  
  <p>A - DPAPI only uses the current User identity the encryption key</p>
  
  <p>B – DPAPI only used the current machine as the encryption key</p>
  
  <p>C- DPAPI used the current user and the current machine as the encryption key (A and B)</p>
  
  <p>Thank you,</p>