This method will decrypt a encrypted capture, using the key you passed to the encryption key parameter.

 @param path [String] the encrypted bytes
 @param key [String] the encryption key
 @return [Array<Byte>] an array of decrypted bytes
188085
def decrypt(data, key)
			if data == nil
				return nil
			end
			iv = data[0..15]
			payload = data[16..-1]
			cipher = OpenSSL::Cipher::Cipher.new("aes-256-cbc")
			cipher.padding = 0
			cipher.key = Base64.strict_decode64(key);
			cipher.iv = iv
			decrypted = cipher.update(payload);
			decrypted << cipher.final();
			return decrypted
		end
1128274
def decrypt(self, recipient_key):
        
        if recipient_key.private_key is None:
            raise ValueError("Cannot decrypt with this key; no private key part found.")
        header = MiniLockHeader(self.header)
        # Create ephemeral public key for authenticated decryption of metadata.
        # TODO: Future-proof this by making it try to decrypt a b58 ephem ID if available?
        decryptInfo = header.decrypt(recipient_key)
        file_info = decryptInfo['fileInfo']
        file_hash = file_info['fileHash']
        if not b64decode(file_hash) == pyblake2.blake2s(self.chunks_block).digest():
            raise ValueError("ciphertext does not match given hash!")
        symbox = SymmetricMiniLock.from_key(b64decode(file_info['fileKey']))
        filename, *filechunks = symbox.decrypt(self.chunks_block, b64decode(file_info['fileNonce']))
        try:
            filename = filename.decode('utf8')
        except Exception as E:
            raise ValueError("Cannot decode filename to UTF8 string: '{}'".format(filename))
        sender = decryptInfo['senderID']
        return filename, sender, b''.join(filechunks)
1000228
def decrypt(data, key):
    ''''''
    data_len = len(data)
    data = ffi.from_buffer(data)
    key = ffi.from_buffer(__tobytes(key))
    out_len = ffi.new('size_t *')
    result = lib.xxtea_decrypt(data, data_len, key, out_len)
    ret = ffi.buffer(result, out_len[0])[:]
    lib.free(result)
    return ret
1212093
public static String decryptString(String string, String key) {
        if (!StringUtils.isEmpty(string)) {
            try {
                return Encryption.decryptString(
                        string, key);
            } catch (EncryptionException e) {
                LOG.error(e.getMessage());
            }
        }
        return "";
    }
510091
function (path) {
  if (!types.isArray(path)) {
    path = [path]
  }
  return _.map(path, toKey)
}
473022
public static String decypt(byte[] b, byte[] key) {
        String _str = null;
        try {
            SecretKey secretKey = new SecretKeySpec(key, "AES");
            Cipher cipher = Cipher.getInstance("AES");
            cipher.init(Cipher.DECRYPT_MODE, secretKey);
            _str = new String(cipher.doFinal(b));
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return _str;
    }
406715
def decrypt_file(file_path, recipient_key, *, base64=False):
    ""
    crypto.assert_type_and_length('recipient_key', recipient_key, crypto.UserLock)
    with open(file_path, "rb") as I:
        contents = I.read()
        if base64:
            contents = crypto.b64decode(contents)
        crypted = crypto.MiniLockFile(contents)
    return crypted.decrypt(recipient_key)
732338
def parse_file(path)
      {}.tap do |hash|
        File.readlines(path).each do |line|
          key, value = line.split(SEPARATOR)
          hash[key] = value.strip
        end
      end
    end
32425
def decrypt(self, encrypted):
        
        fernet = Fernet(self.decryption_cipher_key)
        return fernet.decrypt(encrypted)
433195
async def get_decryption_aes_key(self, key: bytes, material_description: Dict[str, Any]) -> bytes:
        

        # So it seems when java just calls Cipher.getInstance('AES') it'll default to AES/ECB/PKCS5Padding
        aesecb = self._cipher.decryptor()
        padded_result = await self._loop.run_in_executor(None, lambda: (aesecb.update(key) + aesecb.finalize()))

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

        return result
318832
function decrypt(key, encryptedData) {

	var decipher,
		decoded,
		final,
		padding,
		iv = new Buffer.from(new Array(KEYLENGTH + 1).join(' '), 'binary');

	decipher = crypto.createDecipheriv('aes-128-cbc', key, iv);
	decipher.setAutoPadding(false);

	encryptedData = encryptedData.slice(3);

	decoded = decipher.update(encryptedData);

	final = decipher.final();
	final.copy(decoded, decoded.length - 1);

	padding = decoded[decoded.length - 1];
	if (padding) {
		decoded = decoded.slice(0, decoded.length - padding);
	}

	decoded = decoded.toString('utf8');

	return decoded;

}
27967
def encrypt_file(in_path_or_file, out_path_or_file, pk, pk_format=SER_COMPACT,
                 mac_bytes=10, chunk_size=4096, curve=None):
    
    close_in, close_out = False, False
    in_file, out_file = in_path_or_file, out_path_or_file
    try:
        if stringlike(in_path_or_file):
            in_file = open(in_path_or_file, 'rb')
            close_in = True
        if stringlike(out_path_or_file):
            out_file = open(out_path_or_file, 'wb')
            close_out = True
        _encrypt_file(in_file, out_file, pk, pk_format, mac_bytes, chunk_size,
                      curve)
    finally:
        if close_out:
            out_file.close()
        if close_in:
            in_file.close()
429074
def match_to_key(match, path, location)
      key   = super
      scope = match[1]
      if scope
        scope_parts = extract_literal_or_array_of_literals(scope)
        return nil if scope_parts.nil? || scope_parts.empty?
        "#{scope_parts.join('.')}.#{key}"
      else
        key unless match[0] =~ /\A\w/
      end
    end
1178299
def encrypt(data, key):
    ''''''
    data = __tobytes(data)
    data_len = len(data)
    data = ffi.from_buffer(data)
    key = ffi.from_buffer(__tobytes(key))
    out_len = ffi.new('size_t *')
    result = lib.xxtea_encrypt(data, data_len, key, out_len)
    ret = ffi.buffer(result, out_len[0])[:]
    lib.free(result)
    return ret
310493
def path_to_routing_key(path)
      new_path = ""
      path.split('').each_with_index do |c,i|
        if c == '/' and i != 0 and i != path.length-1
          new_path += '.'
        elsif c != '/'
          new_path += c
        end
      end
      new_path
    end
192381
def message
      if valid?
        begin
          Encryption.decrypt(key: @secret.encryption_key,
                             ciphertext: encrypted_message,
                             iv: iv)
        rescue OpenSSL::Cipher::CipherError
          raise InvalidToken, "bad decrypt"
        end
      else
        raise InvalidToken, error_messages
      end
    end
1323335
public function DecryptFile($path, $key)
	{
		if (!file_exists($path))
		{
			throw new GrabzItException("File: " . $path . " does not exist", GrabzItException::FILE_NON_EXISTANT_PATH);
		}
		$data = file_get_contents($path);
		file_put_contents($path, $this->Decrypt($data, $key));
		return true;
	}