Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
74
rated 0 times [  74] [ 0]  / answers: 1 / hits: 55315  / 3 Years ago, wed, august 18, 2021, 5:16:26

I've found lots of info on decrypting PDF files, but none on encrypting them. What tool can do this for me?



Edit: There are two good answers below, but in my specific case the PDF was a scan, not a document that I'd created.


More From » encryption

 Answers
1

Use pdftk. From its man page:



Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)



$ pdftk [mydoc].pdf output [mydoc.128].pdf owner_pw [foopass]


Same as Above, Except a Password is Required to Open the PDF



$ pdftk [mydoc].pdf output [mydoc.128].pdf owner_pw [foo] user_pw [baz]


Same as Above, Except Printing is Allowed (after the PDF is Open)



$ pdftk [mydoc].pdf output [mydoc.128].pdf owner_pw [foo] user_pw [baz] allow printing





pdftk has a lot of other uses as well and is worth installing if one works extensively with PDF files. To quote from the write-up in Synaptic:




If PDF is electronic paper, then pdftk is an electronic
stapler-remover, hole-punch, binder, secret-decoder-ring, and
X-Ray-glasses. Pdftk is a simple tool for doing everyday things with
PDF documents. Keep one in the top drawer of your desktop and use it
to:




  • Merge PDF documents

  • Split PDF pages into a new document

  • Decrypt input as necessary (password required)

  • Encrypt output as desired

  • Fill PDF Forms with FDF Data and/or Flatten Forms

  • Apply a Background Watermark

  • Report PDF on metrics, including metadata and bookmarks

  • Update PDF Metadata

  • Attach Files to PDF Pages or the PDF Document

  • Unpack PDF Attachments

  • Burst a PDF document into single pages

  • Uncompress and re-compress page streams

  • Repair corrupted PDF (where possible)



[#32585] Thursday, August 19, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ncharm

Total Points: 255
Total Questions: 105
Total Answers: 118

Location: Virgin Islands (U.S.)
Member since Sat, May 6, 2023
1 Year ago
ncharm questions
;