luckystar/crypto 问题修复 & 功能扩展

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

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

luckystar/crypto

最新稳定版本:v1

Composer 安装命令:

composer require luckystar/crypto

包简介

README 文档

README

This is a simple PHP library that provides a simple interface for encrypting and decrypting data using the OpenSSL extension.

Installation

You can install the library via Composer. Run the following command:

composer require luckystar/crypto

Function list

Function Description Example
encrypt Encrypt the given data encrypt('Hello, World!')
decrypt Decrypt the given data decrypt('b0lSSVJzeTUwZ1p4WGpmNUY0Zk55NE9janZaZWM1VVhKUEdVUDBSZWh2WT0=')
getOutput Get the output of the encryption or decryption process getOutput()
setSecretKey Set the secret key to use for encryption and decryption setSecretKey('00cccskmmx55')
setSecretIv Set the secret iv to use for encryption and decryption setSecret('00cccskmmx55')
createSecretKey Create a secret key createSecretKey()
createSecretIv Create a secret iv createSecretIv()
createRandomString Create a random string createRandomString($length)
createRandomNumber Create a random number createRandomNumber($length)
createRandomHex Create a random hex createRandomHex($length)
createUuid Create a UUID createUuid()
createRandomPassword Create a random password createRandomPassword($length = 10, $useLowercase = true, $useUppercase = true, $useNumbers = true, $useSymbols = true, $customChars = 'custom list') //!@#$%^&*()_+

Usage

use \LuckyStar\Crypto\Crypto;

// Encrypt data

echo $crypto->setSecretIv('00cccskmmx55')
	->setSecretKey('00	cccxxx55')
	->encrypt('Hello, World!')->getOutput();

// Decrypt data

echo $crypto->decrypt('b0lSSVJzeTUwZ1p4WGpmNUY0Zk55NE9janZaZWM1VVhKUEdVUDBSZWh2WT0=')->getOutput();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-04-14