Encryption/Compression/Zip Tools Workflow
Use this skill when
- The task involves data encryption (AES), compression, or ZIP operations.
- The user needs to protect data, compress assets, or handle ZIP archives.
Path resolution
- Source files:
- Assets/F8Framework/Runtime/Utility/Encryption.cs (~21KB)
- Assets/F8Framework/Runtime/Utility/Compression.cs (~6KB)
- Assets/F8Framework/Runtime/Utility/ZipHelper.cs (~12KB)
Sources of truth
- Source files: Encryption.cs, Compression.cs, ZipHelper.cs in Runtime/Utility
- Third-party: ICSharpCode.SharpZipLib (built-in)
Key capabilities
Encryption (Encryption.cs)
OptimizedAES— AES-256 encryption/decryption- Key and IV management
- Random IV generation (null IV = random)
- Used by StorageManager for local data encryption
- Used by AssetManager for AB encryption
// Example: Create encryptor
var aes = new Util.OptimizedAES(key: "AES_Key", iv: null);
byte[] encrypted = aes.Encrypt(plainBytes);
byte[] decrypted = aes.Decrypt(encrypted);
Compression (Compression.cs)
- Data compression/decompression
- GZip format support
- Used for reducing data transmission size
Zip (ZipHelper.cs)
- ZIP archive creation and extraction
- File-level ZIP operations
- Used by SyncStreamingAssetsLoader for Android StreamingAssets access
- Based on ICSharpCode.SharpZipLib
Workflow
- For encryption: create
OptimizedAESinstance with key. - For compression: use Compression class static methods.
- For ZIP: use ZipHelper for archive operations.
- Storage module uses encryption automatically when configured.
- No module initialization needed — pure utility classes.
Common error handling
| Error | Cause | Solution |
|---|---|---|
| Decryption fails | Key mismatch | Ensure same key across encrypt/decrypt |
| ZIP extraction fails | Corrupt archive | Verify ZIP integrity before extraction |
| Compression ratio poor | Already compressed data | Check if data is already compressed |
Output checklist
- Encryption/compression/ZIP method selected.
- Keys and parameters configured.
- Error handling for crypto/IO failures.
Source: TippingGame/F8Framework — distributed by TomeVault.