Hi, Iīm developing a database with the aes_encrypt and aes_decrypt functions, with integrity constraints and varbinary types.

My problem is that when I insert a row into a table, I encrypt with aes_encrypt, but when I desencrypt with aes_decrypt, it returns null with some values. The only way I've found is using a blob type instead of varbinary, but this type doesn't support integrity constraints.

For example,

create table t1( asunto varbinary(16), asun varbinary(16) );

insert into t1 values(aes_encrypt('aNuevo1','asunto'), 'aNuevo1');

select aes_decrypt(asunto,'asunto') as decrypted, asun from t1;

The result is decrypted=NULL and asun='aNuevo1'

Why ??? The length of the fields is correct, I donīt know why. But if I change varbinary by blob, it runs. But with blob I canīt do any integrity constraint.

Thanks



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to