EncryptionUtils

EncryptionUtils

概要

EncryptionUtils は Aspose.PDF の FOSS における Python 用のクラスです。

PDF 準拠の AES-CBC、RC4 暗号化、キー導出のためのユーティリティクラス。

このクラスは、Python プログラムにおける EncryptionUtils オブジェクトを操作するための 15 のメソッドを提供します。利用可能なメソッドは、compute_file_encryption_key、compute_hash_v5、compute_owner_key_v4、compute_user_key_v4、compute_user_owner_keys_v6、decrypt_aes_cbc、decrypt_rc4、decrypt_writer_encrypted_stream、derive_object_key、encrypt_aes_cbc、encrypt_perms_v6、encrypt_rc4、および追加の 3 つのメソッドです。すべての公開メンバーは、Aspose.PDF の Python 用 FOSS パッケージをインストールした後、任意の Python アプリケーションからアクセス可能です。

メソッド

シグネチャ説明
`encrypt_aes_cbc(key: bytes, data: bytes, iv: bytesNone)→bytes`
decrypt_aes_cbc(key: bytes, data: bytes) → bytesencrypt_aes_cbc によって暗号化されたデータを復号化します。
encrypt_rc4(key: bytes, data: bytes) → bytesRC4 (ARC4) アルゴリズムを使用してデータを暗号化します。
decrypt_rc4(key: bytes, data: bytes) → bytesRC4 (ARC4) アルゴリズムを使用してデータを復号化します。
decrypt_writer_encrypted_stream(file_key: bytes, algorithm: str, obj_id: int, data: bytes) → bytes:meth:PdfWriterV0._encrypt_data が生成したストリームバイトを復号化します。
compute_owner_key_v4(owner_password: str, user_password: str, key_length: int, revision: int) → bytesアルゴリズム 3.3 に従ってオーナーパスワード値 (O) を計算します。
compute_file_encryption_key(password: str, o_value: bytes, p_value: int, file_id: bytes, key_length: int, revision: int, encrypt_metadata: bool) → bytesアルゴリズム 3.2 に従ってファイル暗号化キーを計算します。
compute_user_key_v4(password: str, o_value: bytes, p_value: int, file_id: bytes, key_length: int, revision: int, encrypt_metadata: bool) → tuple[bytes, bytes]アルゴリズム 3.4/3.5 に従ってユーザーパスワード値 (U) と暗号化キーを計算します。
verify_password_v4(password: str, u_value: bytes, o_value: bytes, p_value: int, file_id: bytes, key_length: int, revision: int, encrypt_metadata: bool) → `bytesNone`
compute_hash_v5(password: bytes, salt: bytes, user_key: bytes) → bytesアルゴリズム2.B(ISO 32000-2)に従って V5/R6 のハッシュを計算します。
`compute_user_owner_keys_v6(user_password: str, owner_password: str, file_key: bytesNone)→tuple[bytes, bytes, bytes, bytes]`
verify_password_v6(password: str, u_value: bytes, o_value: bytes, ue_value: bytes, oe_value: bytes) → `bytesNone`
encrypt_perms_v6(file_key: bytes, p_value: int, encrypt_metadata: bool) → bytesR6 用の権限とメタデータフラグを暗号化する。
derive_object_key(file_key: bytes, obj_num: int, gen_num: int, use_aes: bool) → bytesアルゴリズム 3.1 に従ってオブジェクト固有のキーを導出する。
generate_file_id() → bytes新しいドキュメント用にランダムな 16 バイトのファイル ID を生成する。

参照

 日本語