承接 internetpixels/sodium-encryption 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

internetpixels/sodium-encryption

最新稳定版本:1.0.0

Composer 安装命令:

composer require internetpixels/sodium-encryption

包简介

Encrypt and decrypt data with this easy to use PHP encryption library

README 文档

README

Protect your data and secure every field in your entities with this tiny encryption library!

This is a open-source library. Please consider a link to this repository when you're actively using it.

License Build Status Maintainability

Install with composer

This small encryption/decryption library can be required by using composer. Please use the following command:

composer require internetpixels/sodium-encryption

Setup the TokenManager

You have to set the secret and public tokens once. Those keys are not allowed to change overtime!

<?php
// Update the keys (create a new unique keypair)!
\InternetPixels\SodiumEncryption\EncryptionManager::setKeys(
    '1d17336ba7b2cec7dc8ec788e78ebf835d9f85cfc414275e92fd8e3ae5d6d2b6',
    'b88fc95850eec82492e9f0616cfeb69b9205735e34f5ce5e83d681eb38147d57'
);

Encrypt a field

We advise you to create a unique nonce per entity (use the EncryptionManager::generateNonce() method). You'll have to save the nonce with your data too, because it will be used when you want to decrypt the data again.

<?php
$string = 'This is my default text string with 88 numbers!';
$nonce = EncryptionManager::generateNonce();

$encrypted = EncryptionManager::encrypt($string, $nonce);

Decrypt a field

In order to decrypt a field, you'll need the encrypted string and the nonce.

<?php
$string = EncryptionManager::decrypt($encrypted, $nonce);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-06-15

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固