title: Encrypt & Decrypt password using Jasypt
body: <p>It's for a desktop app, so only I want basic login security and I though to use one function to encrypt password and another which I pass pass password from UI and hash save into db and returns true o false depends on if matches or not.</p>
  
  <p>I try to use pooled version from official jasypt website, and I can encrypt but I don't know how to decrypt it.</p>
  
  <pre><code>//Function to encrypt password
  public static String cifrarClave(String clave) {
      PooledStringDigester digester = new PooledStringDigester();
      digester.setPoolSize(4);
      digester.setAlgorithm("SHA-1");
      digester.setIterations(50000);
      digester.setSaltSizeBytes(32);
  
      //String return is hash that I save into db
      return digester.digest(clave);
  }
  
  //Function to decrypt password
  //clave is old plain that user enter from UI and I want to compare from hash save it into db
  public static boolean validarClave(String clave, String hash) {
      PooledStringDigester digester = new PooledStringDigester();
      digester.setPoolSize(4); 
      digester.setAlgorithm("SHA-1");
      digester.setIterations(50000);
  
      String digest = digester.digest(clave);
  
      //Always fails at that point, I get different hash from compare clave
      return digester.matches(digest, hash);
  }
  </code></pre>
  
  <p>I'm a newbie in security, so I don't know much about security, I accept other suggestions or alternatives, I only want a working example.</p>