jdk.security.auth/com.sun.security.auth.module.Crypt - Crypt Tool

Q

How to run "jdk.security.auth/com.sun.security.auth.module.Crypt" tool from JDK lib\modules JImage file?

✍: FYIcenter

A

"jdk.security.auth/com.sun.security.auth.module.Crypt" tool allows you to encrpt a password string like the Unix "crypt" function.

"jdk.security.auth/com.sun.security.auth.module.Crypt" tool is supported by the jmods\jdk.security.auth.jmod module file, which is also linked into the lib\modules JImage file in JDK 9, 10, and 11.

You can run the "jdk.security.auth/com.sun.security.auth.module.Crypt" tool using the lib\modules JImage file as described below using JDK 11 as an example:

C:\fyicenter>set JDK_HOME=\fyicenter\jdk-11.0.1

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.security.auth/com.sun.security.auth.module.Crypt
usage: Crypt password salt

C:\fyicenter>%JDK_HOME%\bin\java --module jdk.security.auth/com.sun.security.auth.module.Crypt MyPassword st

 0 s
 1 t
 2 F
 3 E
 4 f
 5 Q
 6 P
 7 8
 8 b
 9 X
 10 A
 11 o
 12 c

The encrypted password is "FEfQP9bXAoc" after removing the first 2 salt characters in the output.

 

jdk.zipfs/jdk.nio.zipfs.ZipInfo - ZipInfo Tool

jdk.scripting.nashorn.shell/jdk.nashorn.tools.jjs.Main - "jjs" Command

Tools Supported from JDK 9+ lib\modules JImage

⇑⇑ FAQ for JDK (Java Development Kit)

2019-08-08, 232👍, 0💬