laravel-aescrypt
laravel-aescrypt copied to clipboard
How to search with %something% on a WHERE clause?
Hi,
Does your package support searching on encrypted values? If yes, how do you implement it?
Thanks.
Hi,
Any updates?
Thanks.
You should be able to do it with a raw query, like this:
SELECT *, AES_DECRYPT(REPLACE(first_name,'__AESCRYPT__:',''), <aes-key>) AS first_name_aes
FROM people
HAVING first_name_aes LIKE '%something%'
But you need to use a HAVING clause, not a WHERE clause.