in reply to pdftk encryption function

Didn't have PDF::Tk installed, therefore my first answer was wrong. Looking at the source of PDF::Tk, it seens to me it would have to be modified to fit your needs, better use
system ('/apps/free/pdftk/1.44/bin/pdftk', 'apps.pdf', 'output', 'test +.pdf','owner_pw','abc12345') or die ...;
(or
system '/apps/free/pdftk/1.44/bin/pdftk apps.pdf output test.pdf owner +_pw abc12345' or die ...
or use qx). Note the additional output in the command, PDF::Tk does insert this, too, but not where you would want it.

Replies are listed 'Best First'.
Re^2: pdftk encryption function
by sumalatha (Novice) on Sep 23, 2014 at 10:08 UTC

    Thanks for the solution, its working.

    Result of encryption is created a output pdf with password secured rite

    Note: "owner_pw" contains the permission password and "user_pw" contain open document password.

    And Decryption function it just remove the security password by removing owner_pw, but not user_pw

    Please let me know , whether my understanding is correct.

      • there is no encryption at work with regards to the owner password. The password itself probably is encrypted, but otherwise it is only used to indicate to the reading software, which permissions are to be granted. There are PDF readers and tools that ignore these specifications (pdftk not being one of them).
      • The user password however, is in fact used to encrypt the file.
      For more on this consult Wikipedia