![](/img/trans.png)
[英]JBOSS login-config.xml and *-ds.xml (mapping datasources)
[英]How can I decrypt a password that is in the jboss login-config.xml?
是否有jboss提供的API可以用來訪問login-config.xml並解密加密的密碼?
“jaas就是這種方式”至少對於較舊的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
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.