Mysql
 sql >> Database >  >> RDS >> Mysql

Come eseguire una ricerca LIKE con dati crittografati?

AES_ENCRYPT aggiungerà un riempimento attorno alla stringa di input ( https://dev.mysql.com/doc/refman/5.6/en/encryption-functions.html#function_aes-encrypt ), il che significa che il tuo confronto non corrisponderà mai alle stringhe crittografate.

Hai provato a confrontare i valori decifrati? Dovrebbe essere più affidabile.

select id_question 
from question 
where AES_DECRYPT(lib_question, HEX('AVtr34ENMG')) like '%contribuer%';