AppStateBackupEncryptor
object AppStateBackupEncryptor
AES-256-GCM encryption for the AppStateBackup blob.
Schema (v2 — post-PRF):
Blob: [version=0x02 : 1 byte] [IV : 12 bytes] [ciphertext+GCMtag : variable]
Plaintext: [metadataLen : 2 bytes BE] [metadata : 0..N bytes]Content copied to clipboard
Variable length — appMetadata is what differs between dApps (Kicks's witness state ≠ BBoard's drafts ≠ future agent state). The pre-PRF v1 schema padded plaintext to a fixed 496 bytes to hide whether a seed was present. Post-PRF the blob doesn't carry a seed (PRF derives it deterministically from the passkey), so the only thing the size could leak is "this user has app state of approximately N bytes," which the package name already discloses anyway.
All intermediate plaintext is wiped in a finally.