本站中文解释
Block_encryption_mode 是Mysql参数变量,是MySQL服务器用来配置数据块加密的模式的参数。这个参数的设置允许使用服务器的加密功能来保护数据,以避免数据在传输过程中被嗅探或中途窃取。可以使用以下四种模式设置block_encryption_mode参数:
aes-128-ecb : 使用AES-128-ECB加密算法,这是在不提供IV(初始化向量)的情况下性能最高的一种模式。
aes-128-cbc : 使用AES-128-CBC加密算法,提供IV,允许实现更大的安全性。
aes-192-ecb : 使用AES-192-ECB加密算法,不提供IV,性能较前两种算法低一些。
aes-192-cbc : 使用AES-192-CBC加密算法,支持更高安全性,性能稍低于AES-128-CBC算法。
要设置block_encryption_mode参数,可以在MySQL服务器上使用以下命令:
SET GLOBAL block_encryption_mode = ‘aes-128-cbc’;
或者,也可以在MySQL服务器上编辑和更新MySQL配置文件my.cnf,将block_encryption_mode参数增加到文件中,然后重新启动MySQL服务器。
官方英文解释
block_encryption_mode
Command-Line Format | --block-encryption-mode=# |
---|---|
System Variable | block_encryption_mode |
Scope | Global, Session |
Dynamic | Yes |
Type | String |
Default Value | aes-128-ecb |
This variable controls the block encryption mode for
block-based algorithms such as AES. It affects encryption for
AES_ENCRYPT()
and
AES_DECRYPT()
.
block_encryption_mode
takes a
value in
aes-
keylen
-mode
format, where keylen
is the key
length in bits and mode
is the
encryption mode. The value is not case-sensitive. Permitted
keylen
values are 128, 192, and
256. Permitted encryption modes depend on whether MySQL was
compiled using OpenSSL or yaSSL:
-
For OpenSSL, permitted
mode
values are:ECB
,
CBC
,CFB1
,
CFB8
,CFB128
,
OFB
-
For yaSSL, permitted
mode
values are:ECB
,CBC
For example, this statement causes the AES encryption
functions to use a key length of 256 bits and the CBC mode:
SET block_encryption_mode = 'aes-256-cbc';
An error occurs for attempts to set
block_encryption_mode
to a
value containing an unsupported key length or a mode that the
SSL library does not support.