OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
src
/
Crypto
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 10:55:35 AM
rwxr-xr-x
📄
AbstractCryptoClient.php
4.11 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AbstractCryptoClientV2.php
4 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesDecryptingStream.php
3.65 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesEncryptingStream.php
3.83 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesGcmDecryptingStream.php
2.81 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesGcmEncryptingStream.php
3.02 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesStreamInterface.php
686 bytes
08/14/2024 10:51:56 AM
rw-r--r--
📄
AesStreamInterfaceV2.php
759 bytes
08/14/2024 10:51:56 AM
rw-r--r--
📁
Cipher
-
08/14/2024 10:55:07 AM
rwxr-xr-x
📄
DecryptionTrait.php
6.13 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
DecryptionTraitV2.php
9.28 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
EncryptionTrait.php
7.1 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
EncryptionTraitV2.php
7.29 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
KmsMaterialsProvider.php
4.01 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
KmsMaterialsProviderV2.php
3.53 KB
08/14/2024 10:51:56 AM
rw-r--r--
📄
MaterialsProvider.php
3.33 KB
08/14/2024 10:51:57 AM
rw-r--r--
📄
MaterialsProviderInterface.php
1.87 KB
08/14/2024 10:51:57 AM
rw-r--r--
📄
MaterialsProviderInterfaceV2.php
1.72 KB
08/14/2024 10:51:57 AM
rw-r--r--
📄
MaterialsProviderV2.php
2.07 KB
08/14/2024 10:51:57 AM
rw-r--r--
📄
MetadataEnvelope.php
1.7 KB
08/14/2024 10:51:57 AM
rw-r--r--
📄
MetadataStrategyInterface.php
1 KB
08/14/2024 10:51:57 AM
rw-r--r--
📁
Polyfill
-
08/14/2024 10:55:07 AM
rwxr-xr-x
Editing: AesGcmEncryptingStream.php
Close
<?php namespace Aws\Crypto; use Aws\Crypto\Polyfill\AesGcm; use Aws\Crypto\Polyfill\Key; use GuzzleHttp\Psr7; use GuzzleHttp\Psr7\StreamDecoratorTrait; use Psr\Http\Message\StreamInterface; use \RuntimeException; /** * @internal Represents a stream of data to be gcm encrypted. */ class AesGcmEncryptingStream implements AesStreamInterface, AesStreamInterfaceV2 { use StreamDecoratorTrait; private $aad; private $initializationVector; private $key; private $keySize; private $plaintext; private $tag = ''; private $tagLength; /** * @var StreamInterface */ private $stream; /** * Same as non-static 'getAesName' method, allowing calls in a static * context. * * @return string */ public static function getStaticAesName() { return 'AES/GCM/NoPadding'; } /** * @param StreamInterface $plaintext * @param string $key * @param string $initializationVector * @param string $aad * @param int $tagLength * @param int $keySize */ public function __construct( StreamInterface $plaintext, $key, $initializationVector, $aad = '', $tagLength = 16, $keySize = 256 ) { $this->plaintext = $plaintext; $this->key = $key; $this->initializationVector = $initializationVector; $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"; } /** * Same as static method and retained for backwards compatibility * * @return string */ public function getAesName() { return self::getStaticAesName(); } public function getCurrentIv() { return $this->initializationVector; } public function createStream() { if (version_compare(PHP_VERSION, '7.1', '<')) { return Psr7\Utils::streamFor(AesGcm::encrypt( (string) $this->plaintext, $this->initializationVector, new Key($this->key), $this->aad, $this->tag, $this->keySize )); } else { return Psr7\Utils::streamFor(\openssl_encrypt( (string)$this->plaintext, $this->getOpenSslName(), $this->key, OPENSSL_RAW_DATA, $this->initializationVector, $this->tag, $this->aad, $this->tagLength )); } } /** * @return string */ public function getTag() { return $this->tag; } public function isWritable(): bool { return false; } }