pdaleramirez/asymmetric-encryption 问题修复 & 功能扩展

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

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

pdaleramirez/asymmetric-encryption

Composer 安装命令:

composer require pdaleramirez/asymmetric-encryption

包简介

A laravel package that encrypts your data with private public key pairs using asymmetric encryption.

README 文档

README

A laravel package that encrypts your data with private public key pairs using asymmetric encryption.

The way it works is that it encrypts the data with a symmetric key, then asymmetrically encrypt the key and attach it to the data. Useful for encrypting large data. More details here: https://www.sitepoint.com/encrypt-large-messages-asymmetric-keys-phpseclib/

Installation

Step 1: Composer

Via Composer command line:

$ composer require pdaleramirez/asymmetric-encryption

Or add the package to your composer.json:

{
    "require": {
        " pdaleramirez/asymmetric-encryption": "^1.0.0"
    }
}

Step 2: Enable the package

'providers' => [
    pdaleramirez\asymmetric\encryption\AsymmetricEncryptionProvider::class
];

And then add the alias to your config/app.php file:

'aliases' => [
    'AsymmetricEncryption' => pdaleramirez\asymmetric\encryption\AsymmetricEncryptionFacade::class
];

Usage:

Generate the key pairs:

$keys = \AsymmetricEncryption::createKeys();

Encrypting and Decrypting

$textToEncrypt = 'text to encrypt';
$privateKey = file_get_contents('keys/private.key');
$publicKey = file_get_contents('keys/public.pem');

$encryptedData = \AsymmetricEncryption::encrypt($textToEncrypt, $publicKey);

$decryptedData = \AsymmetricEncryption::>decrypt($encryptedData, $privateKey);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2020-02-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固