Bug #78628 [Com]: AES-256-XTS cipher method does not work

From: Date: Fri, 04 Oct 2019 11:06:27 +0000
Subject: Bug #78628 [Com]: AES-256-XTS cipher method does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223065@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78628&edit=1

 ID:                 78628
 Comment by:         alec@php.net
 Reported by:        alec@php.net
 Summary:            AES-256-XTS cipher method does not work
 Status:             Open
 Type:               Bug
 Package:            OpenSSL related
 Operating System:   Linux
 PHP Version:        7.3.10
 Block user comment: N
 Private report:     N

 New Comment:

Additional info:
$ openssl list -cipher-algorithms | grep XTS
AES-128-XTS
AES-256-XTS


Previous Comments:
------------------------------------------------------------------------
[2019-10-03 11:10:13] alec@php.net

Description:
------------
Tested with various PHP versions (7.3.9 and 7.4.0beta4 and some older 7.x) on Ubuntu 18.04. This
originates from on of our users using PHP 7.3 on Debian Stable.

$php -r "print_r(openssl_get_cipher_methods());" | grep -i xts
    [12] => aes-128-xts
    [35] => aes-256-xts

However, if you see the test script openssl_enrypt() does not work, returns false. No error/warning.
The same for AES-128-XTS.

I'm not sure what is expected from OpenSSL in the system, but openssl ciphers -v | grep
XTS returns nothing.

Maybe that's not a bug, but I'd like to hear some explanation for this behavior.

Test script:
---------------
$iv = random_bytes(openssl_cipher_iv_length("aes-256-XTS"));
echo openssl_encrypt("test", "aes-256-XTS", "key", OPENSSL_RAW_DATA,
$iv) === false;

Expected result:
----------------
0

Actual result:
--------------
1


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=78628&edit=1


Thread (4 messages)

« previous php.bugs (#223065) next »