Molca.Networking.UtilsFile:
Packages/com.molca.core/Runtime/Networking/Utils/Encryption.csType:
RuntimeSubsystem (child of RuntimeManager prefab)
When to use
UseEncryption for local at-rest obfuscation of cache data written by CacheManager. For sensitive credentials, use SecureStorage instead.
⚠️ This is at-rest obfuscation, not strong cryptography. The AES key is derived from the configured public-key asset (or deviceUniqueIdentifier as fallback) — both are non-secret material available to the running app.
Role
- Local AES-256-CBC encryption —
EncryptData/DecryptDataencrypt/decrypt byte arrays for cache file storage. IV is randomly generated per operation and prepended to the output. - Key derivation — uses SHA-256 of the configured PEM public key (extracted from
-----BEGIN PUBLIC KEY-----markers) or, if absent,SystemInfo.deviceUniqueIdentifier. - Public-key string flow removed —
EncryptString/DecryptStringare[Obsolete]and throwNotSupportedException. This flow was removed in Sprint 4.6 because it relied on RSA decryption with a public key, which is cryptographically impossible.
Inspector configuration
API Reference
Code
Troubleshooting
EncryptString/DecryptStringthrowNotSupportedException: these methods were removed. UseEncryptData/DecryptDatafor byte-level encryption, orSecureStoragefor credentials.- Different device, different key: without a configured
_publicKeyTextAsset, the key derives fromdeviceUniqueIdentifier, meaning cache files are not portable across devices.
Related
- CacheManager — consumes Encryption for cache file obfuscation
- SecureStorage — encrypted storage for credentials (preferred for sensitive data)
- RuntimeManager —
Encryptionis a child subsystem