定制 creative-world/crypto 二次开发

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

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

creative-world/crypto

最新稳定版本:1.0.0

Composer 安装命令:

composer require creative-world/crypto

包简介

A PHP package for cryptography management using the CryptoModel class.

README 文档

README

Overview

Crypto provides a robust and secure way to handle cryptographic operations in your PHP applications. It includes a CryptoModel class that offers methods for encryption, decryption, token generation, and password hashing. This package is designed to be easy to use while ensuring high security standards.

Features

  • Encryption and Decryption: Securely encrypt and decrypt data using industry-standard algorithms.
  • Token Generation: Generate secure tokens for session management or API authentication.
  • Password Hashing: Hash passwords securely and verify them with ease.
  • Custom Exception Handling: Utilize the CryptoException class for handling cryptographic errors.

Installation

You can install the package via Composer. Run the following command in your terminal:

composer require creative-world/crypto

Usage

Basic Example

use CreativeWorld\Crypto\CryptoModel;

$crypto = new CryptoModel();

// Encrypt data
$encryptedData = $crypto->encrypt('Sensitive Data', 'your-key');

// Decrypt data
$decryptedData = $crypto->decrypt($encryptedData, 'your-key');

// Generate a secure token
$token = $crypto->generateToken();

// Hash a password
$hashedPassword = $crypto->hashPassword('your-password');

// Verify a password
$isPasswordValid = $crypto->verifyPassword('your-password', $hashedPassword);

Testing

To run the tests for this package, ensure you have PHPUnit installed. You can run the tests using the following command:

vendor/bin/phpunit

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any enhancements or bug fixes.

统计信息

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

GitHub 信息

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

其他信息

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