__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
namespace Aws\Crypto;
abstract class MaterialsProvider implements MaterialsProviderInterface
{
private static $supportedKeySizes = [
128 => true,
192 => true,
256 => true,
];
/**
* Returns if the requested size is supported by AES.
*
* @param int $keySize Size of the requested key in bits.
*
* @return bool
*/
public static function isSupportedKeySize($keySize)
{
return isset(self::$supportedKeySizes[$keySize]);
}
/**
* Performs further initialization of the MaterialsProvider based on the
* data inside the MetadataEnvelope.
*
* @param MetadataEnvelope $envelope A storage envelope for encryption
* metadata to be read from.
*
* @return MaterialsProvider
*
* @throws \RuntimeException Thrown when there is an empty or improperly
* formed materials description in the envelope.
*
* @internal
*/
abstract public function fromDecryptionEnvelope(MetadataEnvelope $envelope);
/**
* Returns the material description for this Provider so it can be verified
* by encryption mechanisms.
*
* @return string
*/
abstract public function getMaterialsDescription();
/**
* Returns the wrap algorithm name for this Provider.
*
* @return string
*/
abstract public function getWrapAlgorithmName();
/**
* Takes a content encryption key (CEK) and description to return an
* encrypted key according to the Provider's specifications.
*
* @param string $unencryptedCek Key for use in encrypting other data
* that itself needs to be encrypted by the
* Provider.
* @param string $materialDescription Material Description for use in
* encrypting the $cek.
*
* @return string
*/
abstract public function encryptCek($unencryptedCek, $materialDescription);
/**
* Takes an encrypted content encryption key (CEK) and material description
* for use decrypting the key according to the Provider's specifications.
*
* @param string $encryptedCek Encrypted key to be decrypted by the Provider
* for use decrypting other data.
* @param string $materialDescription Material Description for use in
* encrypting the $cek.
*
* @return string
*/
abstract public function decryptCek($encryptedCek, $materialDescription);
/**
* @param string $keySize Length of a cipher key in bits for generating a
* random content encryption key (CEK).
*
* @return string
*/
public function generateCek($keySize)
{
return openssl_random_pseudo_bytes($keySize / 8);
}
/**
* @param string $openSslName Cipher OpenSSL name to use for generating
* an initialization vector.
*
* @return string
*/
public function generateIv($openSslName)
{
return openssl_random_pseudo_bytes(
openssl_cipher_iv_length($openSslName)
);
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Cipher | Folder | 0777 |
|
|
| Polyfill | Folder | 0777 |
|
|
| AbstractCryptoClient.php | File | 3.99 KB | 0777 |
|
| AbstractCryptoClientV2.php | File | 3.88 KB | 0777 |
|
| AesDecryptingStream.php | File | 3.51 KB | 0777 |
|
| AesEncryptingStream.php | File | 3.68 KB | 0777 |
|
| AesGcmDecryptingStream.php | File | 2.7 KB | 0777 |
|
| AesGcmEncryptingStream.php | File | 2.89 KB | 0777 |
|
| AesStreamInterface.php | File | 656 B | 0777 |
|
| AesStreamInterfaceV2.php | File | 728 B | 0777 |
|
| DecryptionTrait.php | File | 5.96 KB | 0777 |
|
| DecryptionTraitV2.php | File | 9.04 KB | 0777 |
|
| EncryptionTrait.php | File | 6.92 KB | 0777 |
|
| EncryptionTraitV2.php | File | 7.1 KB | 0777 |
|
| KmsMaterialsProvider.php | File | 3.9 KB | 0777 |
|
| KmsMaterialsProviderV2.php | File | 3.43 KB | 0777 |
|
| MaterialsProvider.php | File | 3.23 KB | 0777 |
|
| MaterialsProviderInterface.php | File | 1.81 KB | 0777 |
|
| MaterialsProviderInterfaceV2.php | File | 1.67 KB | 0777 |
|
| MaterialsProviderV2.php | File | 2.01 KB | 0777 |
|
| MetadataEnvelope.php | File | 1.64 KB | 0777 |
|
| MetadataStrategyInterface.php | File | 996 B | 0777 |
|