[MDEV-27104] deprecate DES_ENCRYPT/DECRYPT functions Created: 2021-11-21  Updated: 2023-08-08  Resolved: 2022-07-27

Status: Closed
Project: MariaDB Server
Component/s: Encryption, SSL
Fix Version/s: 10.10.1

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: Preview_10.10

Issue Links:
Relates
relates to MDEV-31873 Remove functions DES_ENCRYPT/DECRYPT Open

 Description   

Hopefully nobody uses them anymore.

https://en.wikipedia.org/wiki/Triple_DES:

The Data Encryption Standard's (DES) 56-bit key is no longer considered adequate in the face of modern cryptanalytic techniques and supercomputing power. A CVE released in 2016, CVE-2016-2183 disclosed a major security vulnerability in DES and 3DES encryption algorithms. This CVE, combined with the inadequate key size of DES and 3DES, NIST has deprecated DES and 3DES for new applications in 2017, and for all applications by 2023. It has been replaced with the more secure, more robust AES.



 Comments   
Comment by Sergei Golubchik [ 2022-06-19 ]

branch preview-10.10-misc

Comment by Michael Widenius [ 2022-06-20 ]

Please stop testing this until it is clearly documented why we should remove this function.

The default is that MariaDB should NOT remove any old functions or functionality that people MAY still use, unless there is a VERY good reason why we cannot support the old functionality anymore.

What have we done to ensure/check that these functions are still not used.
What should users use instead?
How should they migrate old servers/applications?
How can they test if these functions are not in use?

Comment by Sergei Golubchik [ 2022-06-21 ]

These questions will be relevant when we'll be removing this functionality. For now we only warn people that they should not be using DES.
See https://en.wikipedia.org/wiki/Data_Encryption_Standard
DES was superseded in 2001.

A chosen-plaintext attack utilizing a rainbow table can recover the DES key for a single specific chosen plaintext ... in 25 seconds.

One can brute-force the password in 15 days using a $1000 off-the-shelf Nvidia card. Or under 2 days with 8 such cards.

Plain DES is pretty much irrelevant nowadays.

Comment by Sergei Golubchik [ 2022-06-27 ]

in bb-10.10-MDEV-27104 branch

Comment by Lena Startseva [ 2022-07-14 ]

Test main.func_encrypt_nossl fails. Ex.:
Part of test:

-- source include/not_ssl.inc
select des_encrypt("test", 'akeystr');

Expected result:

des_encrypt("test", 'akeystr')
NULL
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release
Warning	1289	The 'des_encrypt' feature is disabled; you need MariaDB built with '--with-ssl' to have it working

Actual result:

des_encrypt("test", 'akeystr')
���+YL���
Warnings:
Note	1287	'des_encrypt' is deprecated and will be removed in a future release

serg, please, fix the test.

Comment by Sergei Golubchik [ 2022-07-18 ]

Not quite. This test was supposed to be run when no ssl support is compiled in.
This is not possible since 5.5, ssl support is always in the binary.

But you can run this test with --mysqld=--skip-ssl. It'll run but fail as above, because ssl support is present in the binary.

I'll update the test.

Comment by Lena Startseva [ 2022-07-25 ]

Now all tests pass.

Generated at Thu Feb 08 09:50:22 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.