Download the PHP package tecnickcom/tc-lib-pdf-encrypt without Composer

On this page you can find all versions of the php package tecnickcom/tc-lib-pdf-encrypt. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package tc-lib-pdf-encrypt

tc-lib-pdf-encrypt

PHP library to encrypt and decrypt PDF data.

Latest Stable Version Build Coverage License Downloads

Sponsor on GitHub

๐Ÿ’– Part of the tc-lib-pdf / TCPDF ecosystem (100M+ installs). Sponsor its maintenance โ†’


Overview

tc-lib-pdf-encrypt implements the encryption and decryption routines of the PDF format: password and certificate handling, key derivation, permission flags and the encryption dictionary.

Namespace \Com\Tecnick\Pdf\Encrypt
Author Nicola Asuni [email protected]
License GNU LGPL v3 - see LICENSE
API docs https://tcpdf.org/docs/srcdoc/tc-lib-pdf-encrypt
Packagist https://packagist.org/packages/tecnickcom/tc-lib-pdf-encrypt

Security Notice

RC4 modes (0 and 1) are cryptographically broken and deprecated. RC4-40 (mode 0) and RC4-128 (mode 1) both emit an E_USER_DEPRECATED notice at runtime. Use AES-128 (mode 2), AES-256 R5 (mode 3), or AES-256 R6 / PDF 2.0 (mode 4) for all new documents.

Mode 0 is the constructor default: pass mode explicitly.

RC4 is also two orders of magnitude slower, because OpenSSL 3 no longer offers the cipher and the bundled implementation runs in PHP. Measured on one 1 MiB stream: RC4-128 3 MiB/s, AES-128 940 MiB/s, AES-256 1000 MiB/s.

Mode Algorithm Security
0 RC4-40 Broken: do not use
1 RC4-128 Broken: do not use
2 AES-128 Acceptable for legacy compatibility
3 AES-256 R5 (PDF 1.7 ext.) Recommended
4 AES-256 R6 (PDF 2.0 / ISO 32000-2) Recommended (most current)

Features

Encryption

Decryption

Interoperability

Encryption dictionaries are verified against qpdf fixtures and against vectors computed from ISO 32000, in both directions, for every revision from R2 to R6.

Passwords are used as supplied. ISO 32000-2 calls for SASLprep (RFC 4013) on R5/R6 passwords and ISO 32000-1 expects PDFDocEncoding for R2 to R4; neither is applied, so non-ASCII passwords may not match other implementations. ASCII passwords are unaffected.

Integration


Requirements


Installation


Quick Start

Encrypting a string

Decrypting a string

Decrypting a document written elsewhere

Pass the raw dictionary entries and let the library derive the mode from /V, /R and /CFM:

/Length may be omitted when /V implies it. Every required entry is checked for presence and type, so a malformed dictionary raises Com\Tecnick\Pdf\Encrypt\Exception.

OpenSSL Note

RC4 is applied by the bundled implementation rather than OpenSSL, so no legacy provider is required on OpenSSL 3. AES uses OpenSSL.


Development


Packaging

For system packages, bootstrap with:


Contributing

Contributions are welcome. Please review SECURITY.md.


All versions of tc-lib-pdf-encrypt with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-ctype Version *
ext-hash Version *
ext-openssl Version *
ext-pcre Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package tecnickcom/tc-lib-pdf-encrypt contains the following files

Loading the files please wait ...