Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how can be search on field? #1

Closed
dnypinkesh opened this issue May 7, 2018 · 3 comments
Closed

how can be search on field? #1

dnypinkesh opened this issue May 7, 2018 · 3 comments

Comments

@dnypinkesh
Copy link

how can we implement search on that encrypted field???

@bcrowe
Copy link
Owner

bcrowe commented May 7, 2018

Hi @dnypinkesh,

So that's a bit of a problem whenever the actual values in a database column are encrypted. (application-level). If you need your data to be searchable and also encrypted, I would explore full-disk or database-level encryption. I linked to this article: https://www.percona.com/blog/2016/04/08/mysql-data-at-rest-encryption/ in the README if you want to read the pros/cons of each approach yourself. Although, push come to shove, I guess you could encrypt the input before supplying it to the WHERE clause if you want a strict equality search, but you'll definitely have to be mindful about its performance and how that would scale.

@bcrowe
Copy link
Owner

bcrowe commented May 23, 2018

Let me know if you have any additional questions.

@bcrowe bcrowe closed this as completed May 23, 2018
@bcrowe
Copy link
Owner

bcrowe commented Apr 23, 2019

Probably too late, but some discussion in the Cake Slack channel just had me revisit this. I butchered this answer. What I meant to say is, you could hash the same value alongside the encrypted value, so that you have it available in plaintext via the encrypted BLOB, but also something consistent to compare/search against via the hashed value. For example: email BLOB (with this plugin), email_hash VARCHAR(255) (Security::hash(...)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants