Server IP : 185.86.78.101 / Your IP : 216.73.216.124 Web Server : Apache System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /www/server/mysql/mysql-test/t/ |
Upload File : |
--source include/have_openssl_version_1.1.0.inc --echo # Tests of the AES KDF hkdf functionality --echo #### AES_ENCRYPT return type --echo # must work and return a string SELECT TO_BASE64(AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf')); --echo # must return 16 SELECT LENGTH(AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf')); --echo # must return binary SELECT CHARSET(AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf')); --echo # must be equal SELECT AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf') = AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf'); --echo # Tests of AES strong key generation --echo # Strong key generation with KDF, should not be equal keys SELECT AES_ENCRYPT('my_text', repeat("x",32), '', 'hkdf') = AES_ENCRYPT('my_text', repeat("y",32), '', 'hkdf'); --echo # Strong key generation with KDF, should not be equal keys SELECT AES_ENCRYPT('my_text', repeat("x",32), '', 'hkdf') = AES_ENCRYPT('my_text', '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0', '', 'hkdf'); --echo #### AES_ENCRYPT KDF hkdf parameters select TO_BASE64(AES_ENCRYPT('my_text','my_key_string', '', 'hkdf')); select TO_BASE64(AES_ENCRYPT('my_text','my_key_string', '', 'hkdf', 'salt')); select TO_BASE64(AES_ENCRYPT('my_text','my_key_string', '', 'hkdf', 'salt', 'info')); SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text', 'my_key_string', '', 'hkdf'), 'my_key_string', '', 'hkdf'); --echo #### AES_ENCRYPT KDF hkdf parameters with incorrect data types SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text','my_key_string', '', 'hkdf', 10001), 'my_key_string', '', 'hkdf', 10001); SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text','my_key_string', '', 'hkdf', 10001, 2000), 'my_key_string', '', 'hkdf', 10001, 2000); --echo # KDF function name different case. --error ER_AES_INVALID_KDF_NAME select aes_encrypt("foo",repeat("x",16),NULL,'hKdF'); --echo #### AES_ENCRYPT KDF hkdf parameters with initialization vector SET @IV=REPEAT('a', 16); --echo #### aes-128-cbc SELECT @@session.block_encryption_mode INTO @save_block_encryption_mode; eval SET SESSION block_encryption_mode="aes-128-cbc"; SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text', 'my_key_string', @IV, 'hkdf'), 'my_key_string', @IV, 'hkdf'); SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text', 'my_key_string', @IV, 'hkdf', 'salt'), 'my_key_string', @IV, 'hkdf', 'salt'); SELECT 'my_text' = AES_DECRYPT(AES_ENCRYPT('my_text', 'my_key_string', @IV, 'hkdf', 'salt', 'info'), 'my_key_string', @IV, 'hkdf', 'salt', 'info'); SET SESSION block_encryption_mode=@save_block_encryption_mode;