API-level encryption