Download the PHP package codecollab/encryption without Composer

On this page you can find all versions of the php package codecollab/encryption. 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 encryption

Encryption

Encryption package of the CodeCollab project

Build Status

Requirements

PHP7+

Installation

Include the library in your project using composer:

{
    "require-dev": {
        "codecollab/encryption": "^2"
    }
}

Usage

This library provides common interfaces and exceptions for handling crypto in your applications.

Generating key

Before being able to encrypt/decrypt data a key needs to be generated / added. To generate a new key use:

$key = (new \CodeCollab\Encryption\Defusev2\Key())->generate();

Note: keys should always be stored in a secure location and should never be made public.

Note: all key share the common CodeCollab\Encryption\Key interface.

Encrypting

$encryptedData = (new \CodeCollab\Encryption\Defusev2\Encryptor($key))->encrypt('the data to encrypt');

Note: all encryptors share the common CodeCollab\Encryption\Encryptor interface.

Decrypting

$decryptedData = (new \CodeCollab\Encryption\Defusev2\Decryptor($key))->decrypt($encryptedData);

Note: all decryptors share the common CodeCollab\Encryption\Decryptor interface.

To decrypt old data encrypted with v1* of this library use the deprecated:

$decryptedData = (new \CodeCollab\Encryption\Defuse\Decryptor($key))->decrypt($encryptedData);

Using your current key. For newly encrypted data create a new and separate key.

Exceptions

This library may emit two different exceptions:

It is important to properly handle these exceptions in your applications.

CryptoException

This exception gets thrown when a key could not be generated or when a message could not be en- / decrypted because of system errors.

FraudException

This exception gets thrown when there has been suspected tampering with messages. This exception should be handled like the message has been tampered with and precautions should be taken.

Upgrading

When upgrading from from v1 to v2 of this library there are breaking changes.

It's not possible anymore to generate a new key or encrypt data using the obsolete CodeCollab\Encryption\Defuse\Key and CodeCollab\Encryption\Defuse\Encrypt classes.

The CodeCollab\Encryption\Defuse package has been superseded by the `CodeCollab\Encryption\Defusev2 package.

Decrypting of data is still possible using the deprecated CodeCollab\Encryption\Defuse\Decrypt::decrypt() method and will be for the foreseeable future.

It is however strongly advised to re-encrypt old data using the new CodeCollab\Encryption\Defusev2 package.

The workflow for this will be:

Contributing

How to contribute

License

MIT

Security issues

If you found a security issue please contact directly by mail instead of using the issue tracker at [email protected]


All versions of encryption with dependencies

PHP Build Version
Package Version
Requires php Version ^7
defuse/php-encryption Version ^2.0
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 codecollab/encryption contains the following files

Loading the files please wait ....