Blind Index Planning

CipherSweet includes a planner to assist developers in determining the safe sizes for an additional blind index on an encrypted field.

Using the planner is straightforward:

const {FieldIndexPlanner} = require('ciphersweet-js');

// First, instantiate the planner for a given field
let planner = new FieldIndexPlanner();

// How many rows do you anticipate?

// # Next, add some information about existing fields
planner.addExistingIndex('name_goes_here', 4, 16);
// ... etc.

let recommended = planner.recommend();

This code snippet should yield the following:

{ min: 4, max: 11 }

In the above example, the existing index ("name_goes_here") has an output size of 4 bits and an input domain of 2^16 possible inputs (16 bits). That is where the 4 and 16 come from, respectively.

How to interpret this data:

If you make the additional index larger than 11, you introduce the risk of leaking data.

If you make it lower than 4, you'll have a lot of false positives and it really would not be worth creating this blind index.

If your additional index has a limited keyspace, you can pass the number of bits to the recommend() method to include this in the calculation.

Furthermore, you can use recommendLow() to only get the lower number, and recommendHigh() to only get the higher number.

Note: If there is no safe value for an additional index, the recommend methods will throw a PlannerException.

Next: Key/Backend Rotation