Download the PHP package driftwood/symmetric-encryption without Composer

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

Latest Stable Version License SymmetricEncryption

PHP wrapper around the OpenSSL library providing preconfigured Authenticated Symmetric Encryption.

Intended use

This class is intended to function as a preconfigured, drop-in option for whenever symmetric encryption is needed within your PHP project.

The SymmetricEncryption class is intended to be used 'as-is': the various class constants defined are not configuration options. Instead, they are there to facilitate easy review of choices made. If you change any of the defined constants, or any other part of the code for that matter, the implied security no longer exists; it would be reduced to just another incarnation of home grown crypto.

Review status

Class SymmetricEncryption has received some informal code reviewing, but not nearly enough to be guaranteed to be secure. Having said that, it is probably more secure than what most people can come up with themselves.

Installation

You can either download the code as a .zip file or use Composer to download it directly from packagist, by adding the following to your composer.json file.

{
    "require": {
        "driftwood/symmetric-encryption": "^2.0.0"
    }
}

Usage

Since SymmetricEncryption comes preconfigured, you can encrypt and decrypt data using:

// Assuming a PSR-4 compatible autoloader

use Driftwood\SymmetricEncryption;
$password = 'correct horse battery staple';

$crypto = new SymmetricEncryption(20);

$encrypted = $crypto->encrypt('Never roll your own crypto.', $password);
$decrypted = $crypto->decrypt($encrypted, $password);

echo $decrypted; // Never roll your own crypto.

Maintenance status

This class is actively maintained, yet there are no frequent updates. This is a good thing: updates would mean that there was something that needed fixing, which is generally a very bad thing in cryptography.

The use of a password instead of a key

SymmetricEncryption expects the user to supply a password. However, passwords are, generally speaking, weak authenticators and it would be more secure to require a strong cryptographic key instead. This choice for requiring a password was made to facilitate maximum simplicity (the user supplied password is stretched into a key using PBKDF2). There is (of course) no maximum password length for SymmetricEncryption, nor is there any requirement that it cannot be binary. So you are strongly encouraged to pick a very long, randomly generated set of bytes as your password.


All versions of symmetric-encryption with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3
ext-openssl Version *
ext-mbstring 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 driftwood/symmetric-encryption contains the following files

Loading the files please wait ....