mirror of
https://gitea.tendokyu.moe/beerpsi/x.git
synced 2025-02-25 22:28:04 +01:00
43 lines
970 B
Python
43 lines
970 B
Python
|
from hashlib import blake2b
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
# MU3.Sys.System.keyIvDigestFixed
|
||
|
KEY_IV_DIGEST_FIXED = bytes([
|
||
|
179, 10, 98, 130, 17, 166, 184, 233, 246, 211,
|
||
|
46, 229, 236, 79, 78, 83, 107, 151, 195, 172,
|
||
|
57, 72, 120, 103, 17, 124, 18, 64, 15, 225,
|
||
|
169, 39
|
||
|
])
|
||
|
|
||
|
if len(sys.argv) < 4:
|
||
|
print(f"Usage: python {os.path.basename(__file__)} <noise0> <noise1> <noise2>")
|
||
|
exit(1)
|
||
|
|
||
|
with open(sys.argv[1], "rb") as f:
|
||
|
key = blake2b(
|
||
|
f.read(),
|
||
|
digest_size=32,
|
||
|
key=KEY_IV_DIGEST_FIXED,
|
||
|
).hexdigest()
|
||
|
|
||
|
print(f"Key: {key}")
|
||
|
|
||
|
with open(sys.argv[2], "rb") as f:
|
||
|
iv = blake2b(
|
||
|
f.read(),
|
||
|
digest_size=32,
|
||
|
key=KEY_IV_DIGEST_FIXED,
|
||
|
).hexdigest()
|
||
|
|
||
|
print(f"IV: {iv}")
|
||
|
|
||
|
with open(sys.argv[3], "rb") as f:
|
||
|
salt = blake2b(
|
||
|
f.read(),
|
||
|
digest_size=32,
|
||
|
key=KEY_IV_DIGEST_FIXED,
|
||
|
).hexdigest()
|
||
|
|
||
|
print(f"Endpoint salt: {salt}")
|