Adding Client-Side Security with a Translucent Database

Many applications do not require a thick layer of security at the server. It is possible to use a modest amount of encryption and one-way functions to obscure the sensitive columns or key-value pairs, a technique often called a translucent database. (See description.)

The simplest solutions use one-way function like SHA-256 at the client to scramble the name and password before storing the information. Here's a quick example of what a table of store purchases might look like before the data is scrambled:

Before Translucency

namepasswordproduct namepurchase datesize 1size 2
Bob JonesSwordfishBrawny PantsJan 24 20093234
Bob JonesSwordfishDancing PantsJan 24 20093234
Mary SmithplasticsBroadway HatJan 24 200910-
Mary SmithplasticsShopping PantsJan 25 20092628
Constance DalmationgreenyShopping PantsJan 26 20092527

After Translucency

SHA256(name&password)product namepurchase datesize 1size 2
a67373bc873aacd99392Brawny PantsJan 24 20093234
a67373bc873aacd99392Dancing PantsJan 24 20093234
3c939a9d9939de993993Broadway HatJan 24 200910-
3c939a9d9939de993993Shopping PantsJan 25 20092628
99929d99c9a999a9dd8dShopping PantsJan 26 20092527

This solution gives the client control of the data in the database without requiring a thick layer on the database to test each transaction. Some advantages are:

There are limitations:

There are many variations on the theme detailed in the book Translucent Databases including:

Here are several case studies:

Client-Side Libraries

Here are some Javascript libraries for implementing client-side security: