是否有 jboss 提供的 API 可用于访问 login-config.xml 并解密加密密码?
9871 次
1 回答
6
“jaas is the way”至少对于较旧的jboss版本(4.x)是默认键。您可以尝试这样的方法来解码编码的字节。
public static String decode( String secret ) {
String retString = "";
try {
byte[] kbytes = "jaas is the way".getBytes();
SecretKeySpec key = new SecretKeySpec( kbytes, "Blowfish" );
BigInteger n = new BigInteger( secret, 16 );
byte[] encoding = n.toByteArray();
Cipher cipher = Cipher.getInstance( "Blowfish" );
cipher.init( Cipher.DECRYPT_MODE, key );
byte[] decode = cipher.doFinal( encoding );
retString = new String( decode );
} catch (Exception ignore) {
ignore.printStackTrace();
}
return retString;
}
一些附加信息
http://www.docjar.com/html/api/org/jboss/resource/security/SecureIdentityLoginModule.java.html
于 2015-05-20T16:52:42.367 回答