# Data masking / Data obfuscation for string int float and date , preserving order and exact matches

I've to mask data into some different value but to keep their property such as order an exact match (substring is yet impossible)

What's the state of the art in data masking? I've some data on which I want to perform a search but I can't use the data as they are. the data type are standard data types, that is, string int float date/datetime/time boolean

For exact matches, I can use a key derivation algorithm, such as pbkf2. it's ok, a bit of overkill for things as integer and float I guess, no? anything better and maybe faster?

However, the real problem that I've is how to have a way to preserve the order. One thing that came to my mind is to add a random value to the original value that is then also added to the value of the search, example: (value:5) 5->10, 4->9 .. trivial but should change the data in a way you have to know some initial data to reconstruct the others. Yet, it's very trivial. is there anything better and more advanced?

For string, substrings matches are rather impossible (homomorphic encryption is still a thing of the future), but is there anything I can use or study as a technique?

• There is an Order Preserving Encryption by Boldyreva – kelalaka Feb 4 '19 at 16:09
• Encryption that preserves the order including w.r.t. a party without a secret needs a special, relaxed definition of security. In particular, such encryption can't be secure under known plaintext attack for the standard definition of that. – fgrieu Feb 4 '19 at 16:11
• Yes, Boldyreva warned in one if his articles as you wanted it I've made it. – kelalaka Feb 4 '19 at 16:14
• i know that it can't be super-secure as encryption. but I would like to have something "better than nothing" – EsseTi Feb 4 '19 at 16:31
• Then try it. Not, the OPE reveals the max and minimum. – kelalaka Feb 4 '19 at 16:46