|
| | _aes_cbc (key, iv, ct) |
| | AES-128-CBC decrypt, truncated to a whole number of blocks.
|
| |
| | decrypt_ds2 (blob, key=DS2_KEY) |
| | Decrypt a DS2 entry: [16B MD5][16B IV][ciphertext], plaintext prefixed by a uint32 length.
|
| |
| | decrypt_iv_prefixed (blob, key) |
| | Decrypt a DSR or DS3 entry.
|
| |
| | decrypt_none (blob) |
| | "Decrypt" an unencrypted entry (PtDE, Elden Ring).
|
| |
| | decrypt_nr (blob, key=NR_KEY) |
| | Decrypt an Elden Ring Nightreign entry: [16B IV][ciphertext].
|
| |
| | nr_checksum_ok (pt) |
| | Does a decrypted Nightreign entry hash to the digest it carries?
|
| |
Per-game entry decryption. Each returns the plaintext game data for one entry,
or None on a bad read.
| sl2.crypto.decrypt_nr |
( |
|
blob, |
|
|
|
key = NR_KEY |
|
) |
| |
Decrypt an Elden Ring Nightreign entry: [16B IV][ciphertext].
Close to DS3's layout and NOT the same, which is the trap. DS3 and DSR put a 16-byte checksum FIRST and the IV second, so their reader takes blob[16:32] as the IV; Nightreign leads with the IV and keeps its MD5 at the end of the plaintext, 28 bytes back. Reading it the DS3 way decrypts to noise that still looks like a buffer.
There is no length prefix either, so nothing here truncates: the whole plaintext is the payload. Use nr_checksum_ok to tell a good decrypt from a bad one.
- Parameters
-
| blob | The raw entry bytes. |
| key | NR_KEY. |
- Returns
- The plaintext, or None if the entry is too short to hold an IV.
Definition at line 78 of file crypto.py.
| sl2.crypto.NR_MD5_FROM_END |
Where the MD5 sits, counting back from the end of a Nightreign plaintext, and how much of the plaintext it covers.
The hash runs from offset 4 to the start of the digest, so the first four bytes and the twelve trailing ones are outside it.
Definition at line 87 of file crypto.py.
Where the MD5 sits, counting back from the end of a Nightreign plaintext, and how much of the plaintext it covers.
The hash runs from offset 4 to the start of the digest, so the first four bytes and the twelve trailing ones are outside it.
Definition at line 87 of file crypto.py.