EncryptionUtils

EncryptionUtils

Przegląd

EncryptionUtils jest klasą w Aspose.PDF FOSS dla Python.

Klasa pomocnicza dla zgodnego z PDF AES-CBC, szyfrowania RC4 i wyprowadzania klucza.

Ta klasa zapewnia 15 metod do pracy z obiektami EncryptionUtils w programach Python. Dostępne metody to: 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 oraz 3 dodatkowe metody. Wszystkie publiczne członki są dostępne dla każdej aplikacji Python po zainstalowaniu pakietu Aspose.PDF FOSS dla Python pakietu.

Metody

SygnaturaOpis
`encrypt_aes_cbc(key: bytes, data: bytes, iv: bytesNone)→bytes`
decrypt_aes_cbc(key: bytes, data: bytes) → bytesOdszyfruj dane zaszyfrowane przez encrypt_aes_cbc.
encrypt_rc4(key: bytes, data: bytes) → bytesSzyfruj dane przy użyciu algorytmu RC4 (ARC4).
decrypt_rc4(key: bytes, data: bytes) → bytesOdszyfruj dane przy użyciu algorytmu RC4 (ARC4).
decrypt_writer_encrypted_stream(file_key: bytes, algorithm: str, obj_id: int, data: bytes) → bytesOdszyfruj bajty strumienia wygenerowane przez :meth:PdfWriterV0._encrypt_data.
compute_owner_key_v4(owner_password: str, user_password: str, key_length: int, revision: int) → bytesOblicz wartość hasła właściciela (O) zgodnie z Algorytmem 3.3.
compute_file_encryption_key(password: str, o_value: bytes, p_value: int, file_id: bytes, key_length: int, revision: int, encrypt_metadata: bool) → bytesOblicz klucz szyfrowania pliku zgodnie z Algorytmem 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]Oblicz wartość hasła użytkownika (U) oraz klucz szyfrowania zgodnie z Algorytmem 3.4/3.5.
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) → bytesOblicz hash dla V5/R6 zgodnie z Algorytmem 2.B (ISO 32000-2).
`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) → bytesZaszyfruj uprawnienia i flagę metadanych dla R6.
derive_object_key(file_key: bytes, obj_num: int, gen_num: int, use_aes: bool) → bytesWygeneruj klucz specyficzny dla obiektu zgodnie z Algorytmem 3.1.
generate_file_id() → bytesWygeneruj losowy 16-bajtowy identyfikator pliku dla nowych dokumentów.

Zobacz także

 Polski