GBase 8a通过aes_encrypt和aes_decrypt进行AES算法加密和解密

GBase 8a提供了aes_decrypt和aes_decrypt实现AES算法的加密和解密,只支持128位数据块模式,以及pkcs7的padding方法。

目录导航

样例


gbase> select hex(aes_encrypt('1234567890abcdefg','123456'));
+------------------------------------------------------------------+
| hex(aes_encrypt('1234567890abcdefg','123456'))                   |
+------------------------------------------------------------------+
| 5EA86DDB6B8227A2EB6313BF0BEAF599AD208E4D68F943AFE004559986CA8E23 |
+------------------------------------------------------------------+
1 row in set (Elapsed: 00:00:00.00)

gbase> select aes_decrypt(unhex('5EA86DDB6B8227A2EB6313BF0BEAF599AD208E4D68F943AFE004559986CA8E23'),'123456');
+-------------------------------------------------------------------------------------------------+
| aes_decrypt(unhex('5EA86DDB6B8227A2EB6313BF0BEAF599AD208E4D68F943AFE004559986CA8E23'),'123456') |
+-------------------------------------------------------------------------------------------------+
| 1234567890abcdefg                                                                               |
+-------------------------------------------------------------------------------------------------+
1 row in set (Elapsed: 00:00:00.00)


发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注