Compare commits

...

10 Commits

15 changed files with 301 additions and 116 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
vendor vendor/
composer.lock composer.lock
tools/

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive"> <phive xmlns="https://phar.io/phive">
<phar name="phpunit" version="^9.6" installed="9.6.17" location="./tools/phpunit" copy="false"/> <phar name="phpunit" version="^9.6" installed="9.6.19" location="./tools/phpunit" copy="false"/>
<phar name="phpcs" version="^3.7.2" installed="3.9.0" location="./tools/phpcs" copy="false"/> <phar name="phpcs" version="^3.7.2" installed="3.10.0" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^3.7.2" installed="3.9.0" location="./tools/phpcbf" copy="false"/> <phar name="phpcbf" version="^3.7.2" installed="3.10.0" location="./tools/phpcbf" copy="false"/>
<phar name="psalm" version="^5.15.0" installed="5.23.1" location="./tools/psalm" copy="false"/> <phar name="psalm" version="^5.15.0" installed="5.24.0" location="./tools/psalm" copy="false"/>
<phar name="phpstan" version="^1.10.37" installed="1.10.63" location="./tools/phpstan" copy="false"/> <phar name="phpstan" version="^1.10.37" installed="1.11.1" location="./tools/phpstan" copy="false"/>
<phar name="phan" version="^5.4.2" installed="5.4.3" location="./tools/phan" copy="false"/> <phar name="phan" version="^5.4.2" installed="5.4.3" location="./tools/phan" copy="false"/>
</phive> </phive>

View File

@@ -1 +1 @@
9.12.0 9.12.2

View File

@@ -53,13 +53,19 @@ echo "[START]";
if [ ! -z "${GITEA_UPLOAD_FILENAME}" ] && if [ ! -z "${GITEA_UPLOAD_FILENAME}" ] &&
[ ! -z "${GITEA_URL_DL}" ] && [ ! -z "${GITEA_URL_PUSH}" ] && [ ! -z "${GITEA_URL_DL}" ] && [ ! -z "${GITEA_URL_PUSH}" ] &&
[ ! -z "${GITEA_USER}" ] && [ ! -z "${GITEA_TOKEN}" ]; then [ ! -z "${GITEA_USER}" ] && [ ! -z "${GITEA_TOKEN}" ]; then
curl -LJO \ if [ ! -f "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" ]; then
--output-dir "${PACKAGE_DOWNLOAD}" \ curl -LJO \
${GITEA_URL_DL}/v${VERSION}.zip; --output-dir "${PACKAGE_DOWNLOAD}" \
curl --user ${GITEA_USER}:${GITEA_TOKEN} \ ${GITEA_URL_DL}/v${VERSION}.zip;
--upload-file "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" \ fi;
${GITEA_URL_PUSH}?version=${VERSION}; if [ ! -f "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" ]; then
echo "${VERSION}" > "${file_last_published}"; echo "Version file does not exist for ${VERSION}";
else
curl --user ${GITEA_USER}:${GITEA_TOKEN} \
--upload-file "${PACKAGE_DOWNLOAD}${GITEA_UPLOAD_FILENAME}-v${VERSION}.zip" \
${GITEA_URL_PUSH}?version=${VERSION};
echo "${VERSION}" > "${file_last_published}";
fi;
else else
echo "Missing either GITEA_UPLOAD_FILENAME, GITEA_URL_DL, GITEA_URL_PUSH, GITEA_USER or GITEA_TOKEN environment variable"; echo "Missing either GITEA_UPLOAD_FILENAME, GITEA_URL_DL, GITEA_URL_PUSH, GITEA_USER or GITEA_TOKEN environment variable";
fi; fi;

View File

@@ -15,6 +15,7 @@ class MimeEncode
/** /**
* wrapper function for mb mime convert * wrapper function for mb mime convert
* for correct conversion with long strings * for correct conversion with long strings
* NOTE: This is only a wrapper for mb_encode_mimeheader to stay compatible
* *
* @param string $string string to encode * @param string $string string to encode
* @param string $encoding target encoding * @param string $encoding target encoding
@@ -29,38 +30,9 @@ class MimeEncode
$current_internal_encoding = mb_internal_encoding(); $current_internal_encoding = mb_internal_encoding();
// set internal encoding, so the mimeheader encode works correctly // set internal encoding, so the mimeheader encode works correctly
mb_internal_encoding($encoding); mb_internal_encoding($encoding);
// if a subject, make a work around for the broken mb_mimencode // use the internal convert to mime header
$pos = 0; // it works from PHP 8.2 on
// after 36 single bytes characters, $string = mb_encode_mimeheader($string, $encoding, 'B', $line_break);
// if then comes MB, it is broken
// has to 2 x 36 < 74 so the mb_encode_mimeheader
// 74 hardcoded split does not get triggered
$split = 36;
$_string = '';
while ($pos < mb_strlen($string, $encoding)) {
$output = mb_strimwidth($string, $pos, $split, "", $encoding);
$pos += mb_strlen($output, $encoding);
// if the strinlen is 0 here, get out of the loop
if (!mb_strlen($output, $encoding)) {
$pos += mb_strlen($string, $encoding);
}
$_string_encoded = mb_encode_mimeheader($output, $encoding);
// only make linebreaks if we have mime encoded code inside
// the space only belongs in the second line
if ($_string && preg_match("/^=\?/", $_string_encoded)) {
$_string .= $line_break . " ";
} elseif (
// hack for plain text with space at the end
mb_strlen($output, $encoding) == $split &&
mb_substr($output, -1, 1, $encoding) == " "
) {
// if output ends with space, add one more
$_string_encoded .= " ";
}
$_string .= $_string_encoded;
}
// strip out any spaces BEFORE a line break
$string = str_replace(" " . $line_break, $line_break, $_string);
// before we end, reset internal encoding // before we end, reset internal encoding
mb_internal_encoding($current_internal_encoding); mb_internal_encoding($current_internal_encoding);
// return mime encoded string // return mime encoded string

View File

@@ -21,58 +21,82 @@ use SodiumException;
class SymmetricEncryption class SymmetricEncryption
{ {
/** @var SymmetricEncryption self instance */
private static SymmetricEncryption $instance;
/** @var string bin hex key */
private string $key = '';
/** /**
* Encrypt a message * init class
* if key not passed, key must be set with createKey
* *
* @param string $message Message to encrypt * @param string|null|null $key
* @param string $key Encryption key (as hex string)
* @return string
* @throws \Exception
* @throws \RangeException
*/ */
public static function encrypt(string $message, string $key): string public function __construct(
string|null $key = null
) {
if ($key != null) {
$this->setKey($key);
}
}
/**
* Returns the singleton self object.
* For function wrapper use
*
* @return SymmetricEncryption object
*/
public static function getInstance(string|null $key = null): self
{
if (empty(self::$instance)) {
self::$instance = new self($key);
}
return self::$instance;
}
/* ************************************************************************
* MARK: PRIVATE
* *************************************************************************/
/**
* create key and check validity
*
* @param string $key The key from which the binary key will be created
* @return string Binary key string
*/
private function createKey(string $key): string
{ {
try { try {
$key = CreateKey::hex2bin($key); $key = CreateKey::hex2bin($key);
} catch (SodiumException $e) { } catch (SodiumException $e) {
throw new \UnexpectedValueException('Invalid hex key'); throw new \UnexpectedValueException('Invalid hex key: ' . $e->getMessage());
} }
if (mb_strlen($key, '8bit') !== SODIUM_CRYPTO_SECRETBOX_KEYBYTES) { if (mb_strlen($key, '8bit') !== SODIUM_CRYPTO_SECRETBOX_KEYBYTES) {
throw new \RangeException( throw new \RangeException(
'Key is not the correct size (must be ' 'Key is not the correct size (must be '
. 'SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes long).' . SODIUM_CRYPTO_SECRETBOX_KEYBYTES . ' bytes long).'
); );
} }
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); return $key;
$cipher = base64_encode(
$nonce
. sodium_crypto_secretbox(
$message,
$nonce,
$key
)
);
sodium_memzero($message);
sodium_memzero($key);
return $cipher;
} }
/** /**
* Decrypt a message * Decryption call
* *
* @param string $encrypted Message encrypted with safeEncrypt() * @param string $encrypted Text to decrypt
* @param string $key Encryption key (as hex string) * @param ?string $key Mandatory encryption key, will throw exception if empty
* @return string * @return string Plain text
* @throws \Exception * @throws \RangeException
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException
*/ */
public static function decrypt(string $encrypted, string $key): string private function decryptData(string $encrypted, ?string $key): string
{ {
try { if (empty($key)) {
$key = CreateKey::hex2bin($key); throw new \UnexpectedValueException('Key not set');
} catch (SodiumException $e) {
throw new \Exception('Invalid hex key');
} }
$key = $this->createKey($key);
$decoded = base64_decode($encrypted); $decoded = base64_decode($encrypted);
$nonce = mb_substr($decoded, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit'); $nonce = mb_substr($decoded, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit');
$ciphertext = mb_substr($decoded, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit'); $ciphertext = mb_substr($decoded, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');
@@ -85,7 +109,7 @@ class SymmetricEncryption
$key $key
); );
} catch (SodiumException $e) { } catch (SodiumException $e) {
throw new \UnexpectedValueException('Invalid ciphertext (too short)'); throw new \UnexpectedValueException('Decipher message failed: ' . $e->getMessage());
} }
if (!is_string($plain)) { if (!is_string($plain)) {
throw new \UnexpectedValueException('Invalid Key'); throw new \UnexpectedValueException('Invalid Key');
@@ -94,6 +118,117 @@ class SymmetricEncryption
sodium_memzero($key); sodium_memzero($key);
return $plain; return $plain;
} }
/**
* Encrypt a message
*
* @param string $message Message to encrypt
* @param ?string $key Mandatory encryption key, will throw exception if empty
* @return string
* @throws \Exception
* @throws \RangeException
*/
private function encryptData(string $message, ?string $key): string
{
if (empty($this->key) || $key === null) {
throw new \UnexpectedValueException('Key not set');
}
$key = $this->createKey($key);
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
try {
$cipher = base64_encode(
$nonce
. sodium_crypto_secretbox(
$message,
$nonce,
$key,
)
);
} catch (SodiumException $e) {
throw new \UnexpectedValueException("Create encrypted message failed: " . $e->getMessage());
}
sodium_memzero($message);
sodium_memzero($key);
return $cipher;
}
/* ************************************************************************
* MARK: PUBLIC
* *************************************************************************/
/**
* set a new key for encryption
*
* @param string $key
* @return void
*/
public function setKey(string $key)
{
if (empty($key)) {
throw new \UnexpectedValueException('Key cannot be empty');
}
$this->key = $key;
}
/**
* Decrypt a message
* static version
*
* @param string $encrypted Message encrypted with safeEncrypt()
* @param string $key Encryption key (as hex string)
* @return string
* @throws \Exception
* @throws \RangeException
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException
*/
public static function decryptKey(string $encrypted, string $key): string
{
return self::getInstance()->decryptData($encrypted, $key);
}
/**
* Decrypt a message
*
* @param string $encrypted Message encrypted with safeEncrypt()
* @return string
* @throws \RangeException
* @throws \UnexpectedValueException
* @throws \UnexpectedValueException
*/
public function decrypt(string $encrypted): string
{
return $this->decryptData($encrypted, $this->key);
}
/**
* Encrypt a message
* static version
*
* @param string $message Message to encrypt
* @param string $key Encryption key (as hex string)
* @return string
* @throws \Exception
* @throws \RangeException
*/
public static function encryptKey(string $message, string $key): string
{
return self::getInstance()->encryptData($message, $key);
}
/**
* Encrypt a message
*
* @param string $message Message to encrypt
* @return string
* @throws \Exception
* @throws \RangeException
*/
public function encrypt(string $message): string
{
return $this->encryptData($message, $this->key);
}
} }
// __END__ // __END__

View File

@@ -15,20 +15,22 @@ php_bin="";
if [ ! -z "${1}" ]; then if [ ! -z "${1}" ]; then
case "${1}" in case "${1}" in
# "7.3") php_bin="/usr/bin/php7.3 "; ;; # "7.3") php_bin="/usr/bin/php7.3 "; ;;
"7.4") php_bin="/usr/bin/php7.4 "; ;; #"7.4") php_bin="/usr/bin/php7.4 "; ;;
"8.0") php_bin="/usr/bin/php8.0 "; ;; #"8.0") php_bin="/usr/bin/php8.0 "; ;;
"8.1") php_bin="/usr/bin/php8.1 "; ;; #"8.1") php_bin="/usr/bin/php8.1 "; ;;
"8.2") php_bin="/usr/bin/php8.2 "; ;; "8.2") php_bin="/usr/bin/php8.2 "; ;;
"8.3") php_bin="/usr/bin/php8.3 "; ;;
*) echo "Not support PHP: ${1}"; exit; ;; *) echo "Not support PHP: ${1}"; exit; ;;
esac; esac;
fi; fi;
if [ ! -z "${2}" ] && [ -z "${php_bin}" ]; then if [ ! -z "${2}" ] && [ -z "${php_bin}" ]; then
case "${2}" in case "${2}" in
# "7.3") php_bin="/usr/bin/php7.3 "; ;; # "7.3") php_bin="/usr/bin/php7.3 "; ;;
"7.4") php_bin="/usr/bin/php7.4 "; ;; #"7.4") php_bin="/usr/bin/php7.4 "; ;;
"8.0") php_bin="/usr/bin/php8.0 "; ;; #"8.0") php_bin="/usr/bin/php8.0 "; ;;
"8.1") php_bin="/usr/bin/php8.1 "; ;; #"8.1") php_bin="/usr/bin/php8.1 "; ;;
"8.2") php_bin="/usr/bin/php8.2 "; ;; "8.2") php_bin="/usr/bin/php8.2 "; ;;
"8.3") php_bin="/usr/bin/php8.3 "; ;;
*) echo "Not support PHP: ${1}"; exit; ;; *) echo "Not support PHP: ${1}"; exit; ;;
esac; esac;
fi; fi;

View File

@@ -33,15 +33,14 @@ final class CoreLibsConvertMimeEncodeTest extends TestCase
'The quick brown fox jumps over the lazy sheep that sleeps in the ravine ' 'The quick brown fox jumps over the lazy sheep that sleeps in the ravine '
. 'and has no idea what is going on here', . 'and has no idea what is going on here',
'UTF-8', 'UTF-8',
'The quick brown fox jumps over the lazy sheep that sleeps in the ravine ' "The quick brown fox jumps over the lazy sheep that sleeps in the ravine and\r\n"
. 'and has no idea what is going on here' . ' has no idea what is going on here'
], ],
'standard with special chars UTF-8' => [ 'standard with special chars UTF-8' => [
'This is ümläßtと漢字もカタカナ!^$%&', 'This is ümläßtと漢字もカタカナ!^$%&',
'UTF-8', 'UTF-8',
'This is =?UTF-8?B?w7xtbMOkw59044Go5ryi5a2X44KC44Kr44K/44Kr44OK77yBIV4k?=' "This is =?UTF-8?B?w7xtbMOkw59044Go5ryi5a2X44KC44Kr44K/44Kr44OK77yBIV4k?=\r\n"
. "\r\n" . ' =?UTF-8?B?JSY=?='
. ' =?UTF-8?B?JQ==?=&'
], ],
'35 chars and space at the end UTF-8' => [ '35 chars and space at the end UTF-8' => [
'12345678901234567890123456789012345 ' '12345678901234567890123456789012345 '
@@ -62,9 +61,8 @@ final class CoreLibsConvertMimeEncodeTest extends TestCase
. 'is there a space?', . 'is there a space?',
'UTF-8', 'UTF-8',
"=?UTF-8?B?44Kr44K/44Kr44OK44Kr44K/44Kr44OK44GL44Gq44Kr44K/44Kr44OK44Kr?=\r\n" "=?UTF-8?B?44Kr44K/44Kr44OK44Kr44K/44Kr44OK44GL44Gq44Kr44K/44Kr44OK44Kr?=\r\n"
. " =?UTF-8?B?44K/44Kr44OK?=\r\n" . " =?UTF-8?B?44K/44Kr44OK44GL44Gq44Kr44K/44Kr44OK44Kr44K/44Kr44OK44GL44Gq?=\r\n"
. " =?UTF-8?B?44GL44Gq44Kr44K/44Kr44OK44Kr44K/44Kr44OK44GL44Gq44Kr44K/44Kr?=\r\n" . " =?UTF-8?B?44Kr44K/44Kr44OK44Kr44K/IGlzIHRoZXJlIGEgc3BhY2U/?="
. " =?UTF-8?B?44OK44Kr44K/?= is there a =?UTF-8?B?c3BhY2U/?="
] ]
]; ];
} }
@@ -85,16 +83,28 @@ final class CoreLibsConvertMimeEncodeTest extends TestCase
// print "MIME: -" . $encoded . "-\n"; // print "MIME: -" . $encoded . "-\n";
$this->assertEquals( $this->assertEquals(
$expected, $expected,
$encoded $encoded,
"__mbMimeEncode"
); );
$decoded = mb_decode_mimeheader($encoded); $decoded = mb_decode_mimeheader($encoded);
// print "INPUT : " . $input . "\n"; // print "ENCODED: " . $encoded . "\n";
// print "DECODED: " . $decoded . "\n"; // print "INPUT : " . $input . " | " . mb_strlen($input) . "\n";
// print "DECODED: " . $decoded . " | " . mb_strlen($decoded) . "\n";
// $test_enc = mb_encode_mimeheader($input, $encoding);
// $test_dec = mb_decode_mimeheader($test_enc);
// print "TEST ENC: " . $test_enc . "\n";
// back compare decoded // back compare decoded
$this->assertEquals( $this->assertEquals(
$input, $input,
$decoded $decoded,
"mb_decode_mimeheader"
); );
// $this->assertEquals(
// $input,
// $test_dec,
// 'mb_encode_to_decode'
// );
} }
} }

View File

@@ -46,12 +46,34 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
public function testEncryptDecryptSuccess(string $input, string $expected): void public function testEncryptDecryptSuccess(string $input, string $expected): void
{ {
$key = CreateKey::generateRandomKey(); $key = CreateKey::generateRandomKey();
$encrypted = SymmetricEncryption::encrypt($input, $key);
$decrypted = SymmetricEncryption::decrypt($encrypted, $key); // test class
$crypt = new SymmetricEncryption($key);
$encrypted = $crypt->encrypt($input);
$decrypted = $crypt->decrypt($encrypted);
$this->assertEquals(
$expected,
$decrypted,
'Class call',
);
// test indirect
$encrypted = SymmetricEncryption::getInstance($key)->encrypt($input);
$decrypted = SymmetricEncryption::getInstance($key)->decrypt($encrypted);
$this->assertEquals(
$expected,
$decrypted,
'Class Instance call',
);
// test static
$encrypted = SymmetricEncryption::encryptKey($input, $key);
$decrypted = SymmetricEncryption::decryptKey($encrypted, $key);
$this->assertEquals( $this->assertEquals(
$expected, $expected,
$decrypted $decrypted,
'Static call',
); );
} }
@@ -86,10 +108,24 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
public function testEncryptFailed(string $input, string $exception_message): void public function testEncryptFailed(string $input, string $exception_message): void
{ {
$key = CreateKey::generateRandomKey(); $key = CreateKey::generateRandomKey();
$encrypted = SymmetricEncryption::encrypt($input, $key);
$wrong_key = CreateKey::generateRandomKey(); $wrong_key = CreateKey::generateRandomKey();
// wrong key in class call
$crypt = new SymmetricEncryption($key);
$encrypted = $crypt->encrypt($input);
$this->expectExceptionMessage($exception_message); $this->expectExceptionMessage($exception_message);
SymmetricEncryption::decrypt($encrypted, $wrong_key); $crypt->setKey($key);
$crypt->decrypt($encrypted);
// class instance
$encrypted = SymmetricEncryption::getInstance($key)->encrypt($input);
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::getInstance($wrong_key)->decrypt($encrypted);
// class static
$encrypted = SymmetricEncryption::encryptKey($input, $key);
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::decryptKey($encrypted, $wrong_key);
} }
/** /**
@@ -107,7 +143,6 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
'too short hex key' => [ 'too short hex key' => [
'key' => '1cabd5cba9e042f12522f4ff2de5c31d233b', 'key' => '1cabd5cba9e042f12522f4ff2de5c31d233b',
'excpetion_message' => 'Key is not the correct size (must be ' 'excpetion_message' => 'Key is not the correct size (must be '
. 'SODIUM_CRYPTO_SECRETBOX_KEYBYTES bytes long).'
], ],
]; ];
} }
@@ -126,13 +161,33 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
*/ */
public function testWrongKey(string $key, string $exception_message): void public function testWrongKey(string $key, string $exception_message): void
{ {
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::encrypt('test', $key);
// we must encrypt valid thing first so we can fail with the wrong kjey
$enc_key = CreateKey::generateRandomKey(); $enc_key = CreateKey::generateRandomKey();
$encrypted = SymmetricEncryption::encrypt('test', $enc_key);
// class
$crypt = new SymmetricEncryption($key);
$this->expectExceptionMessage($exception_message); $this->expectExceptionMessage($exception_message);
SymmetricEncryption::decrypt($encrypted, $key); $crypt->encrypt('test');
$crypt->setKey($enc_key);
$encrypted = $crypt->encrypt('test');
$this->expectExceptionMessage($exception_message);
$crypt->setKey($key);
$crypt->decrypt($encrypted);
// class instance
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::getInstance($key)->encrypt('test');
// we must encrypt valid thing first so we can fail with the wrong key
$encrypted = SymmetricEncryption::getInstance($enc_key)->encrypt('test');
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::getInstance($key)->decrypt($encrypted);
// class static
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::encryptKey('test', $key);
// we must encrypt valid thing first so we can fail with the wrong key
$encrypted = SymmetricEncryption::encryptKey('test', $enc_key);
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::decryptKey($encrypted, $key);
} }
/** /**
@@ -145,7 +200,7 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
return [ return [
'too short ciphertext' => [ 'too short ciphertext' => [
'input' => 'short', 'input' => 'short',
'exception_message' => 'Invalid ciphertext (too short)' 'exception_message' => 'Decipher message failed: '
], ],
]; ];
} }
@@ -164,8 +219,18 @@ final class CoreLibsSecuritySymmetricEncryptionTest extends TestCase
public function testWrongCiphertext(string $input, string $exception_message): void public function testWrongCiphertext(string $input, string $exception_message): void
{ {
$key = CreateKey::generateRandomKey(); $key = CreateKey::generateRandomKey();
// class
$crypt = new SymmetricEncryption($key);
$this->expectExceptionMessage($exception_message); $this->expectExceptionMessage($exception_message);
SymmetricEncryption::decrypt($input, $key); $crypt->decrypt($input);
// class instance
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::getInstance($key)->decrypt($input);
// class static
$this->expectExceptionMessage($exception_message);
SymmetricEncryption::decryptKey($input, $key);
} }
} }

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/phan-5.4.3.phar

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/phpcbf-3.9.0.phar

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/phpcs-3.9.0.phar

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/phpstan-1.10.63.phar

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/phpunit-9.6.17.phar

View File

@@ -1 +0,0 @@
/home/clemens/.phive/phars/psalm-5.23.1.phar