tankfairies/tcrypt
Composer 安装命令:
composer require tankfairies/tcrypt
包简介
End to end encryption hanlder
关键字:
README 文档
README
Tcrypt
This is an implemetation of part of the sodium encryption library providing the ability to do end to end encryption.
https://www.php.net/manual/en/intro.sodium.php
Installation
Install with Composer:
composer require tankfairies/tcrypt
Usage
Instantiate a copied of Keys for handing local key pairs.
$keys = new Keys(); $keys->setPasswordAndSalt('senders_password', 'a_custom_salt_at_least_15_chars_long'); $thePublicSenderKey = $keys->getPublicKey(); $keys = new Keys(); $keys->setPasswordAndSalt('receivers_password', 'a_custom_salt_at_least_15_chars_long'); $thePublicReceiverKey = $keys->getPublicKey();
Example of a generated public key
a322e905bd29167702bfc816a6e5ad2be0d8ede171d3c6e68497a5ef5b316d08
Encrypt the message: -
$crypt = new Encrypt(); $crypt ->setLocalKeys($sendKeys) ->setForeignKey($thePublicReceiverKey); $encryptedMessage = $crypt->enc('my secret message');
This will produce something like: -
9G/vMg4piI778CzVpjcOL/c4kGV7+j0ih+JfuYh0QzWYyfAvwQcy1tW8jXcrb2Fd5aRvkljTeQ55
To Decrypt the message: -
$decrypt = new Decrypt(); $decrypt ->setLocalKeys($keys) ->setForeignKey($thePublicSenderKey); $decryptedMessage = $decrypt->dec($encryptedMessage);
Copyright and license
The tankfairies/tcrypt library is Copyright (c) 2019 Tankfairies (https://tankfairies.com) and licensed for use under the MIT License (MIT).
tankfairies/tcrypt 适用场景与选型建议
tankfairies/tcrypt 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 15 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 09 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「encryption」 「sodium」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 tankfairies/tcrypt 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 tankfairies/tcrypt 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 tankfairies/tcrypt 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Simple helpers for encrypt and decrypt content
A simple PHP class to encrypt a string and decrypt an encrypted string
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Encryption with AES-256 and HMAC-SHA256
Allows installation of Laravel where the PHP Mcrypt extension is not available. Provides encryption using OpenSSL, or by disabling encryption entierly.
High-level cryptographic primitives and security utilities for Maatify systems including password hashing, reversible encryption, HKDF key derivation, and key rotation.
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 7
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-09-05