Quick answer: Wrap encrypted file in CryptoStream, then AssetBundle.LoadFromStream(cryptoStream).
Custom-encrypted bundle deployed. LoadFromFile fails “not a valid asset bundle”. Bytes are encrypted; Unity can’t parse.
The Fix
using System.Security.Cryptography;
var aes = Aes.Create();
aes.Key = key;
aes.IV = iv;
using var file = File.OpenRead(path);
using var crypto = new CryptoStream(file, aes.CreateDecryptor(), CryptoStreamMode.Read);
var bundle = AssetBundle.LoadFromStream(crypto);
CryptoStream decrypts on-demand as Unity reads. Small memory footprint. AsyncOp variant exists for non-blocking.
Verifying
Encrypted file loads. Without crypto: corrupt error. With wrong key: corrupt or stub assets.
“CryptoStream wrap. LoadFromStream. Encrypted clean.”
Related Issues
For AssetBundle dedup, see dedup. For decompression stutter, see stutter.
CryptoStream. Bundle loads.