I've recently upgraded our server from CentOS 6 to CentOS 7 and I am having issues getting pdf encryption working on it.On CentOS 6 I installed libgcj and then the pdftk package. I could then encrypt pdfs using/usr/sbin/pdftk pdfName.pdf output pdfEncrypted.pdf owner_pw 123 user_pe 123I know I cannot install pdftk on CentOS 7 because it does not support libgcj but is there an alternate way to achieve what I need?
CentOS 7 Encrypt a PDF
centos;terminal;encryption;pdf
First Alternative: use qpdf. It's on CentOS 7 base system.# yum install qpdf$ qpdf --encrypt user-password owner-password 40 -- file1.pdf file2.pdfThis will take file1.pdf as input, assign user and owner passwords, a key length of 40(valid values are 40, 128, or 256) and export the encrypted data to file2.pdfTo unlock pdf files:$ qpdf --decrypt --password=password locked.pdf unlocked.pdfYou can find here more qpdf encrypt optionsSecond Alternative: There is the possibility to use any general purpouse file encryption tool. You can find a well explained document about some of them here.