Breaking and Building Encrypted Databases