Chiffrement des tables dans MariaDB
Bonjour à tous,
J'essaie de chiffrer des tables dans MariaDB mais ça plante.
J'ai la version "mariadb Ver 15.1 Distrib 10.11.4-MariaDB, for debian-linux-gnu (x86_64) using EditLine wrapper" sous "Debian 12".
J'ai notamment essayé de suivre ces tuto :
Ce que j'ai fait pour générer mes clés :
Code:
1 2 3 4 5 6 7 8 9 10
|
(echo -n "1;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile
(echo -n "2;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile
(echo -n "3;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile
(echo -n "4;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile
(echo -n "5;" ; openssl rand -hex 32 ) | sudo tee -a /etc/mysql/encryption/keyfile
sudo openssl rand -hex 128 > /etc/mysql/encryption/keyfile.key
sudo openssl enc -aes-256-cbc -md sha1 -pass file:/etc/mysql/encryption/keyfile.key -in /etc/mysql/encryption/keyfile -out /etc/mysql/encryption/keyfile.enc |
Note : je verai plus tard pour un algo plus performant.
Dans la section [mysqld] de /etc/mysql/mariadb.conf.d/50-server.cnf, j'ai mis :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
plugin_load_add = file_key_management
file_key_management
file_key_management_filename = /etc/mysql/encryption/keyfile.enc
file_key_management_filekey = FILE:/etc/mysql/encryption/keyfile.key
file_key_management_encryption_algorithm = AES_CBC
innodb_encrypt_tables = ON
innodb_encrypt_temporary_tables = ON
innodb_encrypt_log = ON
innodb_encryption_threads = 4
innodb_encryption_rotate_key_age = 1 |
Et bien entendu, j'ai relancé :
Code:
1 2
|
systemctl start mariadb |
Et quand j'essaie de créer une table chiffrée :
Code:
1 2 3 4 5 6
|
mysql -uroot -p
CREATE DATABASE foo;
USE foo;
CREATE TABLE a (i int) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4; |
Ben ça plante :
Code:
1 2
|
ERROR 1005 (HY000): Can't create table `foo`.`a` (errno: 140 "Wrong create options") |
Si quelqu'un a une idée... Ca fait plusieurs jours que je bloque dessus...
Th.