sql >> Base de Datos >  >> RDS >> Mysql

Descifrado manual de Ebean

Logré identificar la respuesta. Para MySQL

para descifrar:

SELECT CAST(AES_DECRYPT(encrypted-field,'my-encryption-key') as CHAR(50)) from table

cifrar:

SELECT AES_ENCRYPT(encrypted-field,'my-encryption-key') from table;

Para H2:

cifrar:

ENCRYPT('AES', STRINGTOUTF8('<encryption-key>'), STRINGTOUTF8('<text to be encrypted>'))

descifrar:

TRIM(CHAR(0) FROM UTF8TOSTRING(DECRYPT('AES', STRINGTOUTF8('<encryption-key>'), '<text to be encrypted>')))