Download the PHP package spryker/propel-encryption-behavior without Composer

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

Spryker - PropelEncryptionBehavior

Build Status codecov Latest Stable Version Minimum PHP Version PHPStan License

Seamlessly encrypt/decrypt Propel2 data fields. This library is a plugin for the Propel2 ORM framework. The library is a fork of Athens\Encryption.

For example:

Given the table definition above, the string "Some data that will be encrypted." is encrypted in memory before being sent to the database. When we retrieve MySecretData later, the ciphertext is decrypted before being returned.

Note/Tradeoff

spryker/propel-encryption-behavior breaks Propel's native search/find/sort methods on the encrypted field(s). Because the plain-texts of encrypted fields are not available to the database, no database method of search or sort can operate on these fields. A search or sort can only be accomplished by retrieving all rows, decrypting all values, and performing a search/sort on those. If you have many rows and you need to search/sort on encrypted fields, this process may be impractically slow.

Installation

Use

This client library provides a Cipher class and one Propel2 Behavior class.

To designate a field as encrypted in your Propel schema, set its type as VARBINARY, LONGVARBINARY or BLOB and include the encryption behavior. Parameters that define encrypted columns should contain column_name_* prefix in the name attribute. You may include multiple columns in the encryption behavior:

Then build your models and database as usual.

Before querying the database, you must initialize the Cipher class with your passphrase:

The argument $my_passphrase should be a string of random characters. A length of 32-64 characters is appropriate for your passphrase. Because the cipher is initialized with every page load, the passphrase must be stored on your server in a location accessible to PHP. However, the passphrase should not be in a file which is viewable to web-visitors, and it almost certainly should not be included in your source/version control (git, scm, etc.).

That's it! The class setters for MySecretData and MySecretData2 now seamlessly encrypt their data before it is sent to the database. The class getters for MySecretData and MySecretData2 seamlessly decrypt data after retrieving it from the database.

Remember that search/find and sort are now broken for MySecretData and MySecretData2, for reasons discussed above.

Filtering

By default all encrypted columns are not searchable. It's possible to make all encrypted columns of a table searchable by setting a parameter searchable to true

It's also possible to make a particular column as searchable using searchable_column_name_* prefix

Be aware: For the searchable columns will be used a fixed IV. It looses data security.


All versions of propel-encryption-behavior with dependencies

PHP Build Version
Package Version
Requires php Version >=7.3
propel/propel Version ~2.0@dev
ext-openssl 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 spryker/propel-encryption-behavior contains the following files

Loading the files please wait ....