承接 fixer112/encrypter 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

fixer112/encrypter

最新稳定版本:v1.2.0

Composer 安装命令:

composer require fixer112/encrypter

包简介

Simple AES-256-CBC encrypter decrypter

README 文档

README

Simple AES-256-CBC encryption/decryption PHP library using fixed key and IV loaded from environment variables.

Installation

Install via Composer:

composer require fixer112/encrypter

Environment Setup

Create a .env file in your project root with these variables:

ENCRYPTER_KEY=your-secret-key-here
ENCRYPTER_IV=your-iv-here

Usage

<?php

require 'vendor/autoload.php';

use Fixer112\Encrypter\Encrypter;



try {
    // Load .env (if not using Laravel, you need to load it manually)
    $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
    $dotenv->load();

    $encrypter = new Encrypter();

    //or initiate key and iv

    //$key = $iv = "password";
    //$encrypter = new Encrypter($key,$iv);

    $plaintext = "Hello, world!";
    $encrypted = $encrypter->encrypt($plaintext);
    echo "Encrypted: " . $encrypted . PHP_EOL;

    $decrypted = $encrypter->decrypt($encrypted);
    echo "Decrypted: " . $decrypted . PHP_EOL;

} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}

Notes

  • This package depends on your .env file to provide ENCRYPTER_KEY and ENCRYPTER_IV.

  • Make sure to keep your key and IV secret and do not commit them to public repositories.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固