开发者

is it possible to encrypt columns of a table in mysql DB

Is there any way (native MySQL functions or SQL syntax) to encrypt the columns 开发者_运维技巧of a table in MySQL database?


MySQL has a wide range of built-in encryption functions, you can find a detailled overview here: http://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html

You might want to have a look at e.g. AES_DECRYPT() and AES_ENCRYPT().

INSERT INTO table (mycolumn) VALUES(AES_ENCRYPT('Hello!', 'encryption_key'));
SELECT AES_DECRYPT(mycolumn, 'encryption_key') FROM table;


For encryption functions you can look at: encryption-functions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜