我想一個字符串值轉換爲密鑰DES:轉換字符串,以祕密密鑰
String sb="fffe7a50" //Example of DES key
byte []b=sb.getBytes(); //string to bytes
SecretKey key2 = new SecretKeySpec(b, 0, b.length, "DES");
但是輸出是完全地不同:
[email protected]
我知道號碼後,「@ 「應該是DES的關鍵,但爲什麼結果不同?我該如何解決它?