org-mode-ox-odt icon indicating copy to clipboard operation
org-mode-ox-odt copied to clipboard

Add a way to create password protected documents

Open kjambunathan opened this issue 3 years ago • 2 comments

Add a way to create password protected documents

Protecting All Documents When Saving

Protecting Content in LibreOffice | LibreOffice Help

All documents that are saved in OpenDocument format can be saved with a password. Documents that are saved with a password cannot be opened without the password. The content is secured so that it cannot be read with an external editor. This applies to content, graphics and OLE objects.

  1. Turning on protection Choose File - Save As and mark the Save with password check box. Save the document.
  2. Turning off protection Open the document, entering the correct password. Choose File - Save As and clear the Save with password check box.

Quick links for Getting Started with this

Handling Documents - Apache OpenOffice Wiki : Search for password

Opening a document - Apache OpenOffice Wiki

Encrypting Documents

Encrypting Documents with OpenPGP | LibreOffice Help

kjambunathan avatar Nov 26 '21 02:11 kjambunathan

One can password protect the odt file or one can password protect the PDF file.

According to linux mint - How to set password for pdf files? - Unix & Linux Stack Exchange

You can use the program pdftk` to set both the owner and/or user password

    pdftk input.pdf output output.pdf owner_pw xyz user_pw abc

where owner_pw and user_pw are the commands to add the passwords xyz and abc respectively (you can also specify one or the other but the user_pw is necessary in order to prohibit opening).

You also might want to override the default 40 bit encryption strength by adding:

    .... encrypt_128bit

If you cannot run pdftk as it is no longer in every distro, you can try qpdf. Using qpdf --help gives information on the syntax. Using the same "values" as for pdftk:

    qpdf --encrypt abc xyz 256 -- input.pdf output.pdf

pdftk depends on old libraries, and so is no longer in the repos of Fedora / CentOS. As a replacement, I prefer qpdf

	qpdf --encrypt [readpass] [ownerpass] 256 -- [infile].pdf [outfile].pdf

kjambunathan avatar Nov 29 '21 12:11 kjambunathan

One can password protect the odt file or one can password protect the PDF file.

This implies that org-odt-transform-processes may have to be made aware of org-odt-preferred-output-format. If the final output is odt run the LibreOffice macro for password protection; if the output is pdf instead then run the password protection routine for PDF files.

kjambunathan avatar Nov 29 '21 12:11 kjambunathan