Git Product home page Git Product logo

Comments (4)

harrison314 avatar harrison314 commented on June 24, 2024

No, it is not possible, because encrypted fields can only be searched for an exact match. (Otherwise the encryption would be pointless. On the database side, all encrypted fields are stored as binary data.)

It is only going to make a case insenitive match so that the lowercase value is stored in the encrypted column.

from harrison314.entityframeworkcore.encryption.

mdima avatar mdima commented on June 24, 2024

Ok, clear. Need to understand how to combine this with a table with potentially million of records.

Thank you for your answer.

from harrison314.entityframeworkcore.encryption.

harrison314 avatar harrison314 commented on June 24, 2024

Like this. If it is to be searched (substring, compare numbers,...) by column or indexed, it cannot be encrypted in the database.

If the column is encrypted with the option EncryptionMode.Deterministic, then it is possible to search it for an exact match. But that has its problems, for example, it is possible to statistically estimate what the individual values ​​mean. In this mode, I recommend encrypting unique data (eg. social security number).

If the column is encrypted with the option EncryptionMode.Randomized, it is not possible to search against that column. But the data stored in this way is resistant to statistical attacks.

from harrison314.entityframeworkcore.encryption.

mdima avatar mdima commented on June 24, 2024

The column is encrypted with the option EncryptionMode.Deterministic, the point is that I have two requirements:

  1. Encrypt the personal data (name and surname);
  2. Implement a user friendly search for name and surname... which means "contains with case insensitive".

I totally understand that this two requirements are not coherent, at least with the solutions available right now.

The point is that we have a lot of data in that table, at the moment the only way is to retrieve all the information from the DB (translate the entities to a list of entities) then search on the list, in stead of let SQLServer search for the records and return only the records that match.

from harrison314.entityframeworkcore.encryption.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.