paragonie / ciphersweet

Fast, searchable field-level encryption for PHP projects
https://ciphersweet.paragonie.com
Other
437 stars 32 forks source link

EncryptedField doesn't apply transforms unless it is used in EncryptedRow #22

Closed rlittlefield closed 6 years ago

rlittlefield commented 6 years ago

I noticed that while the EncryptedRow applies the transforms as it generates the blind indexes, the EncryptedField does not call this function. Calls to getBlindIndex will instead produce an index of the entire number.

I tested this by producing a python port (still in progress), which doesn't perform the "last four" part of the transform, but still gets the same blind index value in my version of this test:

https://github.com/paragonie/ciphersweet/blob/master/tests/EncryptedFieldTest.php#L253

paragonie-scott commented 6 years ago

Good catch. I must've refactored too much in an earlier version and removed the transformation processing.

v1.4.0 does the correct thing.