Download the PHP package giftcards/encryption without Composer

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

Giftcards Encryption Library Build Status

Library that helps make configuring and using encrypt schemes easier.

Purpose

This library was made to make managing encryptoin of data eaiser including sourcing encryption keys, rotating keys, using different ciphers, and being able to better keep track of wich data was encrypted with combination of keys

Usage

Basic

to just get going you will need to define at least one key source and one profile.

profiles are the way you tell the encryptor which cipher you want to use and which key you want to use for encrypting/decrypting and key sources are the classes that are in charge of loading a key given its name.

simple example.

If you dont set the default profile you will need to pass the name fo the profile always when encrypting. when decrypting however the same requirements will apply since it will do the same work trying to figure out what profile it was encrypted with.

Diving Deeper

Ciphers

Ciphers are classes following the Giftcards\Encryption\Cipher\CipherInterface they are how you can define different ways to encrypt/decrypt data. The current implementations are

Key Sources

Key sources are classes following the Giftcards\Encryption\Key\SourceInterface they are how you can define ways for the encryptor to load a key they take the key by name and return the key if found and if not they throw an exception. the current implementations are

Profiles

Profiles are a way of grouping a cipher with a key name. The encryptor works wth profiles to decide how to encrypt/decrypt data all it contains is the name of a key and the name of a cipher to use

Cipher Text

Cipher Text are ment to represent data that has been encrypted. The encryptor returns an instance of this that is stringable and will automatically serialize using the serializers mentioned later on if you cast it to a string. The idea is to allow for the encrypted data and the profile used to encrypt it to move together

Cipher Text Serializers/Deserializers

The cipher text serializers and deserializers are in charge of making a cipher text instance into a string for easy storage and deserializing them on the way out before decryption in the encryptor. this allows for them to be stored easily and the encryptor to be able to deal just with cipher texts with all the info on how to decrypt them. There are 2 interfaces Giftcards\Encryption\CipherText\Serializer\SerializerInterface and Giftcards\Encryption\CipherText\Serializer\DeserializerInterface there is a combination interface called SerializerDeserializerInterface which the encryptor actually uses. Separating the interfaces allows for different ways ofr serializing and deserializing. the current implmenentations are

Cipher Text Rotators

These classes allow you to define, in a programmatic way, the places that you would need to rotate an encryption key or encryption algorithm so that you can just keep a list and go through them when you need to rotate, call rotate giving them an optional new profile to use (if no new profile is used the current default encryptor profile will be used to re-encrypt). it allows you to define for exmaple a list of tables along with the specific columns that need key rotation. All the rotators must follow the interface Giftcards\Encryption\CipherText\Rotator\RotatorInterface. implementations currently are

Doctrine ORM Integration

There is a listener + annotation you can use for defining entities that have encrypted fields. they will be automatically decrypted on load and encrypted on flush. you can define which profile to use in the annotation. if none if defined the default profile will be used. You can also define an array of ignored values using the ignoredValues option in the annotation. The default value is array(null)

Builders

there are builder classes that are meant to wrap creation of rotators, serializers, deserializers and key sources.

this allows for you to call the addKeySource($source, $options, $prefix, $addCircularGuard) to add a key source and internal builders will do the work for you. you can call addSerializer($serializer, $options), addDeserializer($deserializer, $options). there is also a builder for rotators that is separate since they aren't used by the encryptor.

the encryptor builder can be instanciated using the EncryptorBuilder::newInstance().

the encryptor builder uses a bunch of sub builders.

the rotator builder is Giftcards\Encryption\CipherText\Rotator\RotatorBuilder.

all these sub builders rely on a factory that holds a builder for every one of the types it creates they can be found in the factory directories under which they are located. they are what allows for them to build based off a $name, $options conbination instead of just instances.

the names in the following builder lists can be passed to the first arg for the builder and the options named after that should be passed as the option array so for example for a builder named foo with options array('bar' => 'baz') you can call addKeySource('foo', array('bar' => 'baz') on the encryptor builder or call add('foo', array('bar' => 'baz') on the key source builder. same for the other builders

Key Source builders

array

container_parameter

ini_file

mongo

vault

Serializer/Deserializer builders

basic

no_profile

Cipher text rotator builders

database_table

doctrine_dbal


All versions of encryption with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
symfony/options-resolver Version ^3.4
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 giftcards/encryption contains the following files

Loading the files please wait ....