Filtering encrypted values with client-side method - PHP + Mongodb - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Thursday, March 10, 2022

Filtering encrypted values with client-side method - PHP + Mongodb

I'm using the "manual client-side" encryption on PHP Driver to Mongodb.

I can insert data using ClientEncryption::encrypt and retrieve data using ClientEncryption::decrypt.

The problem is when I try to filter encrypted fields on MongoDB\Collection::find(['field' => ClientEncryption::encrypt(123456)]. Nothing returns.

So, I'm encrypting the value before searching, because the data is cryptographed on mongo.

Am I doing something wrong?

This is the library that I'm using PHP library manual

Manually Client-Side Encryption

PHP version: 8.1, Mongodb version: 5



source https://stackoverflow.com/questions/71414402/filtering-encrypted-values-with-client-side-method-php-mongodb

No comments:

Post a Comment