syntaxseed/libsodium 问题修复 & 功能扩展

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

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

syntaxseed/libsodium

Composer 安装命令:

composer require syntaxseed/libsodium

包简介

A wrapper/facade class for PHP's Libsodium extension functions. Covers symmetric and public key encryption functions.

README 文档

README

GitHub tag (latest SemVer)   PHP v8.0+   PHP v8.1+   License: MIT
follow on Twitter  Sponsor Project

A wrapper/facade class for PHP's LibSodium extension. Providing symmetric and public key encryption and decryption static methods, and key generation methods.

Hex-encoded: All output converted to hex. Inputs expect hex-encoded values.

Install

Via Composer:

composer require syntaxseed/libsodium

Or add to composer.json:

"require": {
    "syntaxseed/libsodium": "^1.0"
},

Static Functions

  • Symmetric Encryption (one secret key)

    • generateSymmetricKey()
    • symmetricEncrypt($secretString, $symmetricKey)
    • symmetricDecrypt($encryptedString, $nonce, $key)
  • Public-Key Encryption (public/private key pair)

    • generateKeyPair()
    • publicKeyEncrypt($secretString, $theirPublicKey, $ourPrivateKey)
    • publicKeyDecrypt($encryptedString, $nonce, $ourPublicKey, $theirPrivateKey)

Usage

See examples/ directory.

Changelog

  • v1.0.0 - (2018-10-27) Created. Added to GitHub.
    • v1.0.1 - (2018-10-27) Update readme, add Composer instructions.
    • v1.0.2 - (2022-02-02) Test for PHP 8.0. Add example usage file.
    • v1.0.3 - (2022-03-13) Test for PHP 8.1. Fix PSR formatting.
    • v1.0.4 - (2024-12-18) Test for PHP 8.3.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固