Equivalence-based Security for Querying Encrypted Databases: Theory and Application to Privacy Policy Audits