code: public synchronized String encrypt(String plaintext) {
          MessageDigest md = null;
          try {
              md = MessageDigest.getInstance("SHA");
              md.update(plaintext.getBytes(UTF8));
          } catch (Exception e) {
              LOG.log(Level.SEVERE, "Should not happen!", e);
          }
          byte raw[] = md.digest();
  
          return encode(raw);
      }
docs: Encrypt a string using SHA
  @param plaintext the original text
  @return resultant hash