fikoborizqy/bose-crypt 问题修复 & 功能扩展

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

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

fikoborizqy/bose-crypt

Composer 安装命令:

composer require fikoborizqy/bose-crypt

包简介

Cryptography (Borizqy Secure Encryption) encrypts by private-key you decided, decrypts by private-key you decided and public-key that was generated once you encrypt.

README 文档

README

Encrypt and Decrypt string by giving private-key before doing encryption, and insert public-key & private-key for decrypting.

Installation

You can install this directly from github, or you can install it via composer. But, we recommend you to install this library via composer.

  1. Install composer
    If you don't know how to install composer, you can read this: Install Composer
  2. Make your project directory / go to your project directory.
  3. Install by composer
    Open your terminal, go to your project directory, and paste this code:
composer require fikoborizqy/bose-crypt
  1. Include the composer autoload.php
    Open your php project file, and put this on top of your code.
require_once('vendor/autoload.php');

How to use?

When you encrypting data, you need to decide private-key for the plain-text. Let's crack on:

  1. use Bose Class by the namespace
    copy this before you encrypting data! You can change this $class variable as you want.
$class = new \Borizqy\Bose\Bose();
  1. Encrypting data
    To encrypt data, you need to decide the private-key. This private key will be used to encrypt and decrypt data:
$example = $class->encrypt("text example", "this my key", "a", "y");

The output will be of encryption above will be like this:

Object (
    [plain_text] => text example
    [cipher_text] => 01101000101100011000101101110011111001111000010010010101111010111111101111101001111101011000011110000111010010111010101
    [public_key] => 71f7b10vTacnxhz10PgRNQLca10C4amZveG10vlIg7ygo10DQMy72cc10IAQAOJya10u2KMZZ1F10E2K0VHbY10G2oGPVPQ10u2KMZZ1F10E1Rr8N7410I1DvgxBE100iCUmdg1
    [private_key] => this my key
)
  1. Decrypting data
    To decrypt data, you need to prepare cipher-text, public-key, and private-key.
$example = $class->decrypt("01101000101100011000101101110011111001111000010010010101111010111111101111101001111101011000011110000111010010111010101", "this my key", '71f7b10vTacnxhz10PgRNQLca10C4amZveG10vlIg7ygo10DQMy72cc10IAQAOJya10u2KMZZ1F10E2K0VHbY10G2oGPVPQ10u2KMZZ1F10E1Rr8N7410I1DvgxBE100iCUmdg1');

The output will be of decryption above will be like this:

Object (
    [plain_text] => text example
    [cipher_text] => 01101000101100011000101101110011111001111000010010010101111010111111101111101001111101011000011110000111010010111010101
    [public_key] => 71f7b10vTacnxhz10PgRNQLca10C4amZveG10vlIg7ygo10DQMy72cc10IAQAOJya10u2KMZZ1F10E2K0VHbY10G2oGPVPQ10u2KMZZ1F10E1Rr8N7410I1DvgxBE100iCUmdg1
    [private_key] => this my key
)

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固