Skip to content

Instantly share code, notes, and snippets.

@CorneAussems
Created July 19, 2018 12:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CorneAussems/6e40b8d9ccd65ce347ff27ddadf8d9ce to your computer and use it in GitHub Desktop.
Save CorneAussems/6e40b8d9ccd65ce347ff27ddadf8d9ce to your computer and use it in GitHub Desktop.
Get Liferay Tunnel
import com.liferay.portal.kernel.security.pwd.*
try{
String algorithm = PasswordEncryptorUtil.getDefaultPasswordAlgorithmType();
out.println("Algorithm"+algorithm);
String pwdEnc = PasswordEncryptorUtil.encrypt("TEXTTEXTTEXT");
out.println("Password encrypted:"+pwdEnc);
String hexPwd = org.apache.commons.codec.binary.Hex.encodeHexString(pwdEnc.getBytes());
out.println("Password hexed:"+hexPwd);
}catch(e){
out.println("Oops:"+e)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment