1

Is that possible to use where condition in sql after converting data in to encrypted?

bala
  • 33
  • 1
  • 5
  • Have you tried anything? – Joël Salamin Mar 02 '15 at 10:43
  • What kind of encryption are you talking about? Data-at-rest encryption of the database files? That should be transparent to data users. – Thilo Mar 02 '15 at 10:45
  • possible duplicate of [SQL Encrypted Columns in WHERE Clause](http://stackoverflow.com/questions/3560707/sql-encrypted-columns-in-where-clause) – Thilo Mar 02 '15 at 10:56

1 Answers1

1

Not if there is any kind of salt (such as an IV) involved in the encryption. In that case, every time you encrypt the same plaintext you will get a different ciphertext, so that you cannot search for it anymore.

It appears that this is the case with SQL Server's EncryptByKey facility.

Community
  • 1
  • 1
Thilo
  • 257,207
  • 101
  • 511
  • 656
  • Encryption is done in sql itself. i insert the data using following query INSERT INTO dbo.Customer(UserId , FirstName, LastName, dbpassword) VALUES (EncryptByKey(Key_GUID('Key4CellEncryption'),'3'),EncryptByKey(Key_GUID('Key4CellEncryption'),'bala'),EncryptByKey(Key_GUID('Key4CellEncryption'),'malaichamy'),EncryptByKey(Key_GUID('Key4CellEncryption'),'bala')) – bala Mar 02 '15 at 10:46
  • Encryption is done by using following example. http://www.databasejournal.com/features/mssql/granular-or-cell-level-encryption-in-sql-server.html – bala Mar 02 '15 at 10:52