title: Java Preferences Local Secure Storage
body: <p>I'm looking for a <strong>secure</strong> process to store a password in a Java client application.
  I will use <a href="http://docs.oracle.com/javase/7/docs/api/java/util/prefs/Preferences.html" rel="nofollow">Preferences API</a> to store data client side.</p>
  
  <p>I want my Client to be able to store login information (login and password) to speed up next logins. I don't want to keep the password clear, so I'll encrypt it.
  Client / Server communication is established over SSL, so I can store keys server-side.</p>
  
  <p>My first proposition is that on successfull login, the server sends the client a key to encrypt his password then store it. Then on next session opening, the client sends his last session id back to server who answers by the decryption key.</p>
  
  <p>This could be using private / public keys or only one key.</p>
  
  <p>I thing it's not secure as the session id will be stored clear so anyone could decrypt the password...</p>
  
  <p>Any proposition, there must be a classic process for this..?</p>
  
  <p>Thanks in advance !</p>