定制 ride/lib-encryption 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

ride/lib-encryption

最新稳定版本:1.1.0

Composer 安装命令:

composer require ride/lib-encryption

包简介

Encryption library of the Ride framework

README 文档

README

Encryption library of the PHP Ride framework.

What's In This Library

Cipher

The Cipher interface is used to implement a cipher to encrypt and decrypt data using an encryption key.

Available implementations:

  • ride\library\encryption\cipher\ChainCipher: Chain of ciphers with an certain amount of iterations
  • ride\library\encryption\cipher\GenericCipher: Generic implementation
  • ride\library\encryption\cipher\SimpleCipher: Simple implementation with relative short length of encrypted data, not secure for sensitive data

Hash

The Hash interface is used to implement cryptographic hash algorithms. These are methods which take an arbitrary block of data and return a fixed-size bit string

Available implementations:

  • ride\library\encryption\hash\GenericHash: Use installed hash functions, defaults to SHA256
  • ride\library\encryption\hash\PlainHash: For testing purposes

Code Sample

Check this code sample to see the possibilities of this library:

<?php

use ride\library\encryption\cipher\GenericCipher;
use ride\library\encryption\exception\EncryptionException;
use ride\library\encryption\hash\GenericHash;

// cipher to encrypt and decrypt data
try {
    $cipher = new GenericCiper();
    $data = "Top secret mission";
    
    // if you don't have a secret key, you can generate one
    $key = $cipher->generateKey();
    
    $encrypted = $cipher->encrypt($data, $key);
    $decrypted = $cipher->decrypt($encrypted, $key); 
} catch (EncryptionException $exception) {
    // something's up!
}

// hash to generate a code of fixed size, good for passwords
$hash = new GenericHash();
$data = $hash->hash($data); 

Installation

You can use Composer to install this library.

composer require ride/lib-encryption

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-02-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固