import
java.io.IOException;
import
java.nio.charset.StandardCharsets;
import
java.security.MessageDigest;
import
java.security.NoSuchAlgorithmException;
import
java.lang.String;
public
class
Main {
public
static
byte
[] subBytes(
byte
[] src,
int
begin,
int
count) {
byte
[] bs =
new
byte
[count];
for
(
int
i = begin; i < begin + count; i++) {
bs[i - begin] = src[i];
}
return
bs;
}
public
static
byte
[] GetKeySeed(String seed,
int
keylen)
throws
NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance(
"SHA1"
);
MessageDigest rd = MessageDigest.getInstance(
"SHA1"
);
byte
[] keyst = md.digest(seed.getBytes(StandardCharsets.UTF_8));
return
subBytes(rd.digest(keyst),
0
, keylen);
}
public
static
void
main(String[] args)
throws
IOException, NoSuchAlgorithmException {
String KeyPrivate =
"kGfIzsWnQBvW"
;
String SaltPrivate =
"3s1Zj1hvDi90"
;
byte
[] arr =
new
byte
[
16
];
arr=GetKeySeed(KeyPrivate + SaltPrivate,
16
);
for
(
int
i =
0
; i < arr.length; i++) {
System.out.printf(
"0x%02X,"
, arr[i] &
0xFF
);
}
System.out.println(
"\n"
+arr.length);
}
}