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

Decrittografia manuale Ebean

Sono riuscito a identificare la risposta. Per MySQL

per decifrare:

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

per crittografare:

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

Per H2:

crittografare:

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

decifrare:

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