title: safe way to "encrypt" or lock created file for unauthorized user - Java
body: <p>I am working on a own project to store my private passwords into a file.</p>
  
  <p>But the biggest problem is that everyone can open this file.<br>
  I am looking for a method to <strong>lock</strong> or <strong>encrypt</strong> the data inside and maybe to decrypt only with the application in use.</p>
  
  <p>The program takes 2 raw-Strings for username and password.<br>
  I know from a lot of sources and sites that storing raw Strings for password is one of the biggest leaks in programming.</p>
  
  <p>Is there any safe way to avoid data theft from any virus and unauthorized users?</p>