Download the PHP package smolowik/propel-behavior-mysql-encryption without Composer
On this page you can find all versions of the php package smolowik/propel-behavior-mysql-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smolowik/propel-behavior-mysql-encryption
More information about smolowik/propel-behavior-mysql-encryption
Files in smolowik/propel-behavior-mysql-encryption
Package propel-behavior-mysql-encryption
Short Description Behavior which allows you to encrypt columns using mysql
License MIT
Informations about the package propel-behavior-mysql-encryption
mysql_encryption behavior for propel 2.x
This behavior is written for propel 2.x and it uses mysql functions AES_ENCRYPT and AES_DECRYPT for encryption.
Instalation
How to use
First you need to define the encryption key:
Then, add the behavior to the table:
In this part you define which columns should be encrypted. In our example, this columns: first_name, last_name and email.
After building the model and update the database schema, you should be able to use encrypted columns as with any other in the table. I use this behavior to getting the list (paginate) with searching and sorting. I use it also to read and write individual rows from the database. If you want to use it in a more sophisticated way, you should thoroughly test it yourself.
SpeedTest
Test was made on Author table with fields id, first_name, last_name and email. Fields first_name, last_name and email are encrypted. The table was 33097 lines.
With no encryption:
- insert (1000 rows) 546ms
- findByFirstName (10 rows) 37ms
- paginate (page 20 with 50 items and orderedByFirstName) 31ms
With encryption with mysql_encryption behavior
- insert (1000 rows) 584ms
- findByFirstName (10 rows) 128ms
- paginate (page 20 with 50 items and orderedByFirstName) 139ms
With encryption with uwdoem/encryption behavior
- insert (1000 rows) 577ms
- findByFirstName (10 rows) not available
- paginate (page 20 with 50 items and orderedByFirstName) not available