开发者

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

开发者 https://www.devze.com 2023-04-05 07:55 出处:网络
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 detai

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

精彩评论

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

关注公众号