当前位置:网站首页>How to encrypt the data in MySQL database? Mysql8.0 comes with new features
How to encrypt the data in MySQL database? Mysql8.0 comes with new features
2022-07-27 19:58:00 【Operation and maintenance home】

===============================================================================================================================================================================
Encryption function is mainly used to encrypt data and process interface , To ensure that some important data are not obtained by others .
Encryption function MD5(str)
md5(str) String calculate one md5 128 Bit checksum .
The value is expressed in 32 Returns... As a binary string of hexadecimal digits , If the parameter is null, Then the returned value is null;
mysql> select md5('yunweijia'), length(md5('yunweijia'));
+----------------------------------+--------------------------+
| md5('yunweijia') | length(md5('yunweijia')) |
+----------------------------------+--------------------------+
| e1c2c47c0b1d8ca6076030bf8e8ea42a | 32 |
+----------------------------------+--------------------------+
1 row in set (0.00 sec)
mysql>
You can see that it is indeed a 32 String of hexadecimal digits with bit length .
Encryption function SHA(str)
SHA(str) From the original plaintext password str Calculate and return the encrypted password string , When the parameter is null When , The returned value is null.
SHA Encryption algorithm relative to MD5 encryption algorithm , It will be safer .
mysql> select sha('yunweijia');
+------------------------------------------+
| sha('yunweijia') |
+------------------------------------------+
| 683501978a90d76d420b893cd7e00c8efde8e8f3 |
+------------------------------------------+
1 row in set (0.00 sec)
mysql>
Encryption function SHA2(str, hash_length)
SHA2(str, hash_length): Use hash_length As length , Encrypted string str;
hash_length The value of support is :224、256、384、512 and 0, Why is there 0 Well , If it is 0 Words , It's the equivalent of 256 了 .
mysql> select sha2('yunweijia', 256) as A, sha2('yunweijia', 0) as B\G;
*************************** 1. row ***************************
A: 1c60cca8fb0ef62bbf751245f72bbb7c308d59d773214133dc6051cd4acd0b64
B: 1c60cca8fb0ef62bbf751245f72bbb7c308d59d773214133dc6051cd4acd0b64
1 row in set (0.00 sec)
ERROR:
No query specified
mysql>
From the above running results, we can see ha , When our hash_length The value of is 256 and 0 when , Their results are consistent .
thus , In this paper, the end .
For more information, go to VX official account “ Operation and maintenance home ” , Get the latest article .
------ “ Operation and maintenance home ” ------
------ “ Operation and maintenance home ” ------
------ “ Operation and maintenance home ” ------
linux Interrupt exception ,linuxuml modeling ,linux Compile multiple source files ,linux How to update the time ,linux Paging video tutorial in ,
linux How to decompress gzip,linux Unzip a directory , How to close linux gateway ,linux Document structure diagram ,linux Improve the permission to execute ,
linux What mark is used in the document , Network security linux strengthening ,linux Check email in ,linux Change the background color ,linux Build a website under the environment .
边栏推荐
- Datepicker and TimePicker
- Common errors reported by pytorch
- SumMenuDemo(子菜单)
- Online Judge 输出超限
- C193:评分系统
- 剑指 Offer 25. 合并两个排序的链表
- [basic knowledge of in-depth learning - 40] Why does CNN have more advantages than DNN in the field of images
- Detailed interpretation of IEC104 protocol (I) protocol structure
- 第2章 入门
- 11.5.OSPF
猜你喜欢
随机推荐
SumMenuDemo(子菜单)
cesium基本控件介绍
ACL11.12
Summenudemo (submenu)
focal loss
Fileoutputstream (file storage) and FileInputStream (file reading)
JS 寻找所有节点sibling childNodes children
强化学习介绍
注入攻击
pytorch乘法以及广播机制
ContextMenu(上下文菜单)
Broadcastreceiver (broadcast)
成年人只有一份主业是要付出代价的,被人事劝退后,我哭了一整晚
An unknown fastcgi error occurred in IIS: 0x80070005
函数总结
Application pool has been disabled
JS find all nodes sibling childNodes children
IDEA:解决代码没有提示问题
Detailed interpretation of IEC104 protocol (II) interaction process and protocol analysis
ACL11.12








