Using predicates for encrypted data
When data is encrypted, only = and <> predicates provide accurate results. Predicates such as >, <, and LIKE return inaccurate results for encrypted data.
About this task
Suppose that the value 1234 is encrypted as H71G. Also suppose that the value 5678 is encrypted as BF62. If you use a <> predicate to compare these two values in encrypted format, you receive the same result as you will if you compare these two values in decrypted format:
Decrypted: 1234 <> 5678 True
Encrypted: H71G <> BF62 True
In both case, they are not equal. However, if you use a < predicate to compare these values in encrypted format, you receive a different result than you will if you compare these two values in decrypted format:
Decrypted: 1234 < 5678 True
Encrypted: H71G < BF62 False
To ensure that predicates such as >, <, and LIKE return accurate results, you must first decrypt the data.