Get decryption key for a given S3 object

        :param key: Base64 decoded version of x-amz-key-v2
        :param material_description: JSON decoded x-amz-matdesc
        :return: Raw AES key bytes
545973
async def get_decryption_aes_key(self, key: bytes, material_description: Dict[str, Any]) -> bytes:
        
        raise NotImplementedError()
419585
def _gen_key(self, key):
        
        b_key = self._md5_digest(key)
        return self._hashi(b_key, lambda x: x)
112899
def EncryptPrivateKey(self, decrypted):
        
        aes = AES.new(self._master_key, AES.MODE_CBC, self._iv)
        return aes.encrypt(decrypted)
1227084
def _convert_key_to_str(key):
    '''
    
    '''
    # IMPORTANT: on PY2, the secret key must be str and not unicode to work
    # properly with hmac.new (see http://bugs.python.org/issue5285)
    #
    # pylint: disable=incompatible-py3-code,undefined-variable
    return salt.utils.data.encode(key) \
        if six.PY2 and isinstance(key, unicode) \
        else key
138800
public static DecryptionTool get(Key<DecryptionTool> key) {
    if (key == null)
      return new NullDecryptionTool();
    DecryptionTool decrypt = DKV.getGet(key);
    return decrypt == null ? new NullDecryptionTool() : decrypt;
  }
189169
def _decode_key(self, key):
        
        bkey = codecs.decode(key.encode(self._keyencoding), 'hex_codec')
        return bkey.decode(self._keyencoding) if self._serialize else bkey
1248920
def key_bytes(self):
        
        return self.key.private_bytes(
            encoding=serialization.Encoding.DER,
            format=serialization.PrivateFormat.PKCS8,
            encryption_algorithm=serialization.NoEncryption(),
        )
1361865
def _key(self):
        
        return (
            self._name,
            self._field_type.upper(),
            self._mode.upper(),
            self._description,
            self._fields,
        )
914713
def todict(self):
        
        return {"f_key": hb_encode(self.f_key),
                "alpha_key": hb_encode(self.alpha_key),
                "chunks": self.chunks,
                "encrypted": self.encrypted,
                "iv": hb_encode(self.iv),
                "hmac": hb_encode(self.hmac)}
142257
@Override
    public Map<String, String> getMaterialsDescription() {
        return matDesc == null
             ? encryptionMaterials.getMaterialsDescription()
             : matDesc
             ;
    }
256130
public String decrypt(String encrytedText, String key) {
        Objects.requireNonNull(encrytedText, Required.ENCRYPTED_TEXT.toString());
        Objects.requireNonNull(key, Required.KEY.toString());

        CipherParameters cipherParameters = new ParametersWithRandom(new KeyParameter(getSizedSecret(key).getBytes(StandardCharsets.UTF_8)));
        this.paddedBufferedBlockCipher.init(false, cipherParameters);
        
        return new String(cipherData(base64Decoder.decode(encrytedText)), StandardCharsets.UTF_8);
    }
77850
function getKey() {
      let paramString =
        width + 'x' + height + '-'
        + path
        + (is2x ? '-@2x' : '')
        + (bg ? `_${bg}` : '')
        + (crop ? '_crop' : '')
        + (mode ? `_${mode}` : '')
        + (trim ? '_trim' : '');

      return paramString + '-' + crypto.createHash('sha1').update(paramString).digest('hex');
    }
990632
def get_key(self, path):
        
        (bucket, key) = self._path_to_bucket_and_key(path)

        if self._exists(bucket, key):
            return self.s3.ObjectSummary(bucket, key)
880109
async def get_encryption_aes_key(self) -> Tuple[bytes, Dict[str, str], str]:
        

        random_bytes = os.urandom(32)

        padder = PKCS7(AES.block_size).padder()
        padded_result = await self._loop.run_in_executor(
            None, lambda: (padder.update(random_bytes) + padder.finalize()))

        aesecb = self._cipher.encryptor()
        encrypted_result = await self._loop.run_in_executor(
            None, lambda: (aesecb.update(padded_result) + aesecb.finalize()))

        return random_bytes, {}, base64.b64encode(encrypted_result).decode()
455283
def _hashed_key(self):
        
        return abs(int(hashlib.md5(
            self.key_prefix.encode('utf8')
        ).hexdigest(), 16)) % (10 ** (
            self._size_mod if hasattr(self, '_size_mod') else 5))
166514
def get_key(self, key_id):
        
        url = ENCRYPTION_KEY_URL.format(key_id)
        return self._key_from_json(self._get_resource(url))
189483
def urlstate(self, encryption_key):
        
        lzma = LZMACompressor()
        urlstate_data = json.dumps(self._state_dict)
        urlstate_data = lzma.compress(urlstate_data.encode("UTF-8"))
        urlstate_data += lzma.flush()
        urlstate_data = _AESCipher(encryption_key).encrypt(urlstate_data)
        lzma = LZMACompressor()
        urlstate_data = lzma.compress(urlstate_data)
        urlstate_data += lzma.flush()
        urlstate_data = base64.urlsafe_b64encode(urlstate_data)
        return urlstate_data.decode("utf-8")