Download the PHP package brrittoo/field-dynamic-encryption without Composer
On this page you can find all versions of the php package brrittoo/field-dynamic-encryption. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brrittoo/field-dynamic-encryption
More information about brrittoo/field-dynamic-encryption
Files in brrittoo/field-dynamic-encryption
Package field-dynamic-encryption
Short Description Laravel package for dynamic field name encryption/decryption
License MIT
Informations about the package field-dynamic-encryption
Field Dynamic Encryption for Laravel
A Laravel package for dynamically encrypting and decrypting form field names to enhance security.
Installation
-
Install via Composer:
- Publish the configuration file:
Update Your Configuration:
- Set encryption keys in your .env file:
Usage In Blade Templates Use the @field syntax in your form field names:
In JavaScript Use the encoded field names when accessing form fields:
In Jquery Use the encoded field names when accessing form fields:
Manual Encoding/Decoding
Configuration
After publishing the configuration file, you can modify config/field-encryption.php: --- encryption_key: Your encryption key (32 characters recommended) --- encryption_iv: Your initialization vector (16 characters) --- exclude_fields: Field names that should not be encrypted --- middleware_registration: How middleware is registered
Middleware
The package includes two middleware classes: EncodeFieldNamesInView: Encodes field names in responses DecodeFieldName: Decodes field names in requests These are automatically registered based on your configuration.
Security
Always use strong, randomly generated encryption keys Keep your encryption keys secure and never commit them to version control Regularly rotate your encryption keys for enhanced security
License
This package is open-source software licensed under the MIT license.