#1 2013-06-19 14:10:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,183
Website

SynPDF now implements 40 bit and 128 bit security

The trunk version now features encryption using 40 bit or 128 bit key size.
See http://synopse.info/fossil/info/6822e8c67f

This is a long awaiting feature, and sounds working just fine from my tests.
Speed has been optimized (as usual with our libraries), as a consequence encrypting the content will only be slightly slower.

In fact, TPdfEncryption.New() will create the expected TPdfEncryption instance, depending on the supplied encryption Level:

class function TPdfEncryption.New(aLevel: TPdfEncryptionLevel;
      const aUserPassword, aOwnerPassword: string;
      aPermissions: TPdfEncryptionPermissions): TPdfEncryption;

Here are some comments about this new method:
- to be called as parameter of TPdfDocument/TPdfDocumentGDI.Create()
- currently, only elRC4_40 and elRC4_128 levels are implemented
- both passwords are expected to be ASCII-7 characters only
- aUserPassword will be asked at file opening: to be set to '' for not blocking display, but optional permission
- aOwnerPassword shall not be '', and will be used internally to cypher the pdf file content
- aPermissions can be either one of the PDF_PERMISSION_ALL / PDF_PERMISSION_NOMODIF / PDF_PERSMISSION_NOPRINT / PDF_PERMISSION_NOCOPY / PDF_PERMISSION_NOCOPYNORPRINT set of options

In practice, typical use may be:

Doc := TPdfDocument.Create(false,0,false,
   TPdfEncryption.New(elRC4_40,'','toto',PDF_PERMISSION_NOMODIF));
Doc := TPdfDocument.Create(false,0,false,
   TPdfEncryption.New(elRC4_128,'','toto',PDF_PERMISSION_NOCOPYNORPRINT));

See http://blog.synopse.info/post/2013/06/1 … t-security

Offline

Board footer

Powered by FluxBB