# Save File Decryption

## Overview
Game save files (`SaveData.sav` and `SubSaveData001001.sav`) are protected using **AES-256-CBC** encryption. Decryption requires the 32-byte master key (shared with the asset bundle encryption) and a valid Initialization Vector (IV) extracted from the file header.

## Encryption Scheme

| Property | Value |
|---|---|
| Cipher | AES-256-CBC |
| Key | 32 ASCII bytes: `rK7CcATuZk7LAmhqqU4iBLNmAq8QbK3s` |
| IV Source | First 16 bytes of the encrypted save file |
| Padding | PKCS7 |

## Decryption Process

To decrypt the files, you must isolate the IV from the beginning of the file and pass the remaining data through an AES-CBC cipher. There is a script that automates this process by testing various IV configurations, confirming that the first 16 bytes serve as the IV.


### Understanding AES-CBC Mode

In CBC (Cipher Block Chaining) mode, each block of ciphertext is XORed with the previous ciphertext block after decryption. The first block requires the Initialization Vector (IV) to perform this operation. Using the first 16 bytes of the file as the IV is a common standard in Unity-based save systems.
