sumeetghimire/encrypt-decrypt-with-key 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sumeetghimire/encrypt-decrypt-with-key

最新稳定版本:1.0.5

Composer 安装命令:

composer require sumeetghimire/encrypt-decrypt-with-key

包简介

A Laravel package for encrypting and decrypting strings with a key (Fixed: Prevents repeated key generation)

README 文档

README

EncryptDecryptWithKey

Laravel EncryptDecryptWithKey Package - Version 1.0.5

🚀 Key Generation Fix

Fixed Issue: The package was previously generating new encryption keys on every request, which caused performance issues and potential data corruption.

What was fixed:

  • Added key caching to prevent repeated environment variable reads
  • Improved service provider to only generate keys once during installation
  • Enhanced error handling and key validation

Configuration

You can customize the package configuration by modifying the config/encrypt-decrypt.php file.

License

The Laravel EncryptDecryptWithKey package is open-sourced software licensed under the MIT license.

Support

For any issues or suggestions, please open an issue on GitHub.

Credits

This package is maintained by Sumeet Ghimire.

Laravel

Require this package in your composer.json and update composer.

composer require sumeetghimire/encrypt-decrypt-with-key

Example How to use

    use SumeetGhimire\EncryptDecryptWithKey\EncryptionHelper;
    $encryptedString = EncryptionHelper::encryptString('test');
    $decryptedString = EncryptionHelper::decryptString($encryptedString);
    return $decryptedString; // Returns 'test'
  

Key Management

  • Automatic Generation: The package will automatically generate a secure key if none exists
  • Key Caching: Keys are cached in memory for performance
  • Key Rotation: Use EncryptionHelper::clearCache() to clear cached keys when rotating

In .env key will be auto generated change as per your requirement

      ENCRYPT_KEY=8141b227d15377e8249b4c2cd42df4a7
  

统计信息

  • 总下载量: 35
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-02