承接 amculin/vigenere-cipher 相关项目开发

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

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

amculin/vigenere-cipher

最新稳定版本:v1.3

Composer 安装命令:

composer require amculin/vigenere-cipher

包简介

Implementation of Vigenere Cipher algorithm in PHP

README 文档

README

GitHub Repo stars Packagist Download Packagist Version Passed Build Workflow Passed PHPStan Level 10

Optimized with PHP CS Fixer Checked using Psalm

Encrypt/decrypt string using Vigenere Cipher algorithm

Instalation

composer require amculin/vigenere-cipher

How to use

Encryption

use amculin\cryptography\classic\VigenereCipher;

$data = 'testtheencryptionprocess';
$key = 'thisisthekey';

//Basic mode only support lowercase alphabet
//You can use alpha_numeric mode for wider supported characters (a-z, A-Z, 0-9)
//You can also use base64 mode to use Radix-64 character list (A-Z, a-z, 0-9, +/=)
$encrypted = VigenereCipher::encrypt($data, $key, 'basic');

echo "Plain text: {$data}\n";
echo "Key: {$key}\n";
echo "Cipher Text: {$encrypted}\n";

Output:

Plain text: testtheencryptionprocess
Key: thisisthekey
Cipher Text: mlalbzxlrmvwiaqgvhkvgowq

Decryption

use amculin\cryptography\classic\VigenereCipher;

$data = 'mlalbzxlrmvwiaqgvhkvgowq';
$key = 'thisisthekey';
$decrypted = VigenereCipher::decrypt($data, $key, 'basic');

echo "Cipher text: {$data}\n";
echo "Key: {$key}\n";
echo "Plain Text: {$decrypted}\n";

Output:

Cipher Text: mlalbzxlrmvwiaqgvhkvgowq
Key: thisisthekey
Plain text: testtheencryptionprocess

Features

  • Support basic mode/lowercase alphabet only
  • Support alpha-numeric mode (a-z, A-Z, 0-9)
  • Unit test
  • Comply PHPStan Level 10
  • Checked using Psalm
  • Optimized using PHP CS Fixer
  • Add Base64 mode to support Base64 string

Todos

  • Add ASCII mode to support file encryption/decryption

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-27