Jenkins專有用戶數(shù)據(jù)庫加密算法簡析
來源:易賢網(wǎng) 閱讀:1258 次 日期:2015-08-25 15:30:37
溫馨提示:易賢網(wǎng)小編為您整理了“Jenkins專有用戶數(shù)據(jù)庫加密算法簡析”,方便廣大網(wǎng)友查閱!

名單

HudsonPrivateSecurityRealm.java詳細路徑是:jenkins/core/src/main/java/hudson/security/HudsonPrivateSecurityRealm.java

通過分析該源碼得知:

1、密文的格式為:salt: encPass,其中以#jbcrypt表示salt作為數(shù)據(jù)頭

2、明文通過jbcrypt算法得到密文 encPass

關于jbcrypt:

jbcrypt是bcrypt加密工具的java實現(xiàn)。

它的API非常簡單,DEMO如下,在HudsonPrivateSecurityRealm.java中可以看到加密和校驗時使用了如下API:

// Hash a password for the first time

String hashed = BCrypt.hashpw(password, BCrypt.gensalt());

// gensalt's log_rounds parameter determines the complexity the work factor is 2**log_rounds, and the default is 10

String hashed = BCrypt.hashpw(password, BCrypt.gensalt(12));

// Check that an unencrypted password matches one that has previously been hashed

if (BCrypt.checkpw(candidate, hashed))

System.out.println("It matches");

else

System.out.println("It does not match");

經(jīng)驗證,用jbcrypt對同一個明文加密后因為salt一般不同,加密后的密文一般不同

關于bcrypt:

1、bcrypt是不可逆的加密算法,無法通過解密密文得到明文。

2、bcrypt和其他對稱或非對稱加密方式不同的是,不是直接解密得到明文,也不是二次加密比較密文,而是把明文和存儲的密文一塊運算得到另一個密文,如果這兩個密文相同則驗證成功。

綜上,Jenkins專有用戶數(shù)據(jù)庫使用了jbcrypt加密,jbcrypt加密是不可逆的,而且對于同一個明文的加密結果一般不同。

更多信息請查看IT技術專欄

更多信息請查看數(shù)據(jù)庫
易賢網(wǎng)手機網(wǎng)站地址:Jenkins專有用戶數(shù)據(jù)庫加密算法簡析

2025國考·省考課程試聽報名

  • 報班類型
  • 姓名
  • 手機號
  • 驗證碼
關于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務許可證:(云)人服證字(2023)第0102001523號
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關注公眾號:hfpxwx
咨詢QQ:1093837350(9:00—18:00)版權所有:易賢網(wǎng)