Download the PHP package assistenzde/simple-cryptographic-bundle without Composer
On this page you can find all versions of the php package assistenzde/simple-cryptographic-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download assistenzde/simple-cryptographic-bundle
More information about assistenzde/simple-cryptographic-bundle
Files in assistenzde/simple-cryptographic-bundle
Package simple-cryptographic-bundle
Short Description A simple cryptographic service to encode/decode an input string with openssl_encrypt methods like aes128, aes256, blowfish and other cipher methods.
License MIT
Homepage https://github.com/assistenzde/simple-cryptographic-bundle
Informations about the package simple-cryptographic-bundle
Simple Cryptographic Bundle
The SimpleCryptographicService class contains method to encrypt/decrypt phrases with symmetric encryption. With the usage of OpenSSL each encoding of the same phrase results in a different encoded string.
Quick example usage:
This library can be used easily in Symfony projects but also in non-Symfony projects.
Table of Contents
- Requirements
- Installation
- Symfony Configuration
- Usage
- Credits
Requirements
The usage of PHP ≥ v7.4 and Symfony ≥ 5 is recommended.
Installation
Please install via composer.
The bundle will be automatically added to your bundles.yaml
configuration.
Symfony Configuration
By default the bundle depends on the APP_SECRET
environment variable and uses the aes-256-ctr
cipher method. If you want to use a custom cipher key OR a customer cipher method create the
config/packates/simple-cryptographic-bundle.yaml
configuration file and set the related values.
simple-cryptographic-bundle.yaml:
Usage
Use dependency injection to access the cryptographic service.
We suggest using the public methods
- SimpleCryptographicService::encrypt and
- SimpleCryptographicService::decrypt.
To temporarily use custom settings switch to the static methods
- SimpleCryptographicService::EncryptWithMethod and/or
- SimpleCryptographicService::DecryptWithMethod.
Credits
A big thank you to stackoverflow's user Scott Arciszewski for the explanations in of the https://stackoverflow.com/a/30189841/4351778 answer.
All versions of simple-cryptographic-bundle with dependencies
php Version >=7.4
symfony/config Version ^5.0
symfony/dependency-injection Version ^5.0
symfony/http-kernel Version ^5.0