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 अतिरिक्त मेथड्स। सभी सार्वजनिक सदस्य किसी भी Python एप्लिकेशन के लिए उपलब्ध हैं, Aspose.PDF FOSS for Python पैकेज को इंस्टॉल करने के बाद।
विधियाँ
| हस्ताक्षर | विवरण |
|---|---|
| `encrypt_aes_cbc(key: bytes, data: bytes, iv: bytes | None)→bytes` |
decrypt_aes_cbc(key: bytes, data: bytes) → bytes | encrypt_aes_cbc द्वारा एन्क्रिप्ट किए गए डेटा को डिक्रिप्ट करें। |
encrypt_rc4(key: bytes, data: bytes) → bytes | RC4 (ARC4) एल्गोरिद्म का उपयोग करके डेटा एन्क्रिप्ट करें। |
decrypt_rc4(key: bytes, data: bytes) → bytes | RC4 (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) → `bytes | None` |
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: bytes | None)→tuple[bytes, bytes, bytes, bytes]` |
verify_password_v6(password: str, u_value: bytes, o_value: bytes, ue_value: bytes, oe_value: bytes) → `bytes | None` |
encrypt_perms_v6(file_key: bytes, p_value: int, encrypt_metadata: bool) → bytes | R6 के लिए अनुमतियों और मेटाडेटा फ़्लैग को एन्क्रिप्ट करें। |
derive_object_key(file_key: bytes, obj_num: int, gen_num: int, use_aes: bool) → bytes | एल्गोरिदम 3.1 के अनुसार ऑब्जेक्ट-विशिष्ट कुंजी प्राप्त करें। |
generate_file_id() → bytes | नए दस्तावेज़ों के लिए एक रैंडम 16-बाइट फ़ाइल ID उत्पन्न करें। |