smakecloud/laravel-sodium 问题修复 & 功能扩展

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

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

smakecloud/laravel-sodium

最新稳定版本:v0.0.2

Composer 安装命令:

composer require smakecloud/laravel-sodium

包简介

Laravel libsodium

README 文档

README

phpunit phpstan

Uses PHP's Sodium extension to encrypt, decrypt, sign and verify data.

Note Package name was chosen for discoverability. It is not affiliated with Laravel.

Supported encryption ciphers are:

Supported signing algorithms are:

Signing KeyPair is generated using app.key for seeding.

Warning This package overrides Laravel's Encrypter class!

You will lose support for the following ciphers:

  • AES-128-CBC
  • AES-256-CBC
  • AES-128-GCM

Table of Contents

Requirements

  • PHP 8.1+
  • Sodium extension ( obviously )

Installation

You can install the package via composer:

composer require smakecloud/laravel-sodium

This package uses Laravel's auto-discovery feature. After you install it the package provider and facade are available immediately.

Usage

This package overrides Laravel's Encrypter class. You can use it as you would use the default Encrypter class.

You can change the default cipher in:

config/app.php

return [
    //...

    'cipher' => 'XCha-Cha20-Poly1305',

    //...
]
$encrypted = encrypt('secret');
$decrypted = decrypt($encrypted); // 'secret'

$signed = sign('secret');
$verified = verify($signed); // 'secret'

$signature = sign_detached('secret');
$verified = verify_detached($signature, 'secret'); // true

Development

Testing

composer test

Coverage

composer test:coverage

Static analysis

composer phpstan

Code style

composer lint(:fix)

Disclaimer

This package is not affiliated with Laravel in any way.

Read the documentation of PHPs sodium extension before using this package !

We don't take any responsibility for any damage caused by this package.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 4
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固