mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-12 08:52:32 +00:00
* craft-pdf: the standard security handler from PdfCraft (`crypt`) Adds the `crypt` feature: PdfCraft's pdfcraft-crypt crate (revision 2b65ab000bfe0997dec5fbed2769d3da3799355b) as craft_pdf::crypt, with its unit, integration and property tests. The code is unchanged; doc comments and test imports name the new module. It decrypts and encrypts strings and streams for revisions 2 to 6 and creates encryption dictionaries. The reader keeps its own decryptor. * craft-pdf: the crypt unit tests build for wasm The property test in src/crypt/tests.rs needs proptest, which is a dev-dependency of the non-wasm targets only. It is now compiled for those targets only; the other unit tests still build for wasm. * craft-pdf: crypt create sets every bit revision 2 reserves Revision 2 reserves bits 7 to 32 of /P, later revisions bits 7-8 and 13-32. create left bits 9 to 12 as the caller gave them for RC4-40. Ported from storytold/pdfcraft#2789 (the create half; the accessors already read /P by revision). * craft-pdf: crypt can encrypt only embedded files create_attachments_only builds AES encryption whose /StmF and /StrF are /Identity and whose /EFF is the standard filter (ISO 32000-2 §7.6.6). RC4-40 and RC4-128 have no crypt filters and are refused. Ported from storytold/pdfcraft#5071 (the crypt half). The test is new: the source change tests it through PdfCraft's object layer. --------- Co-authored-by: Ahmad Mujahid <me@ahmadmu.com> Co-authored-by: Harrison Booth <73434116+Harrison-Booth@users.noreply.github.com>