PHPackages                             amculin/vigenere-cipher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. amculin/vigenere-cipher

ActiveLibrary[Security](/categories/security)

amculin/vigenere-cipher
=======================

Implementation of Vigenere Cipher algorithm in PHP

v1.3(10mo ago)19[1 PRs](https://github.com/amculin/php-vigenere-cipher/pulls)MITPHPCI passing

Since Feb 26Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/amculin/php-vigenere-cipher)[ Packagist](https://packagist.org/packages/amculin/vigenere-cipher)[ RSS](/packages/amculin-vigenere-cipher/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (7)Used By (0)

**Implementation of Vigenere Cipher in PHP**
============================================

[](#implementation-of-vigenere-cipher-in-php)

 [![GitHub Repo stars](https://camo.githubusercontent.com/edc7fec6e4e3f0d0c2f11ddca235d415a04002dad6a130d737b09306aa70eea2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d63756c696e2f7068702d766967656e6572652d636970686572)](https://camo.githubusercontent.com/edc7fec6e4e3f0d0c2f11ddca235d415a04002dad6a130d737b09306aa70eea2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d63756c696e2f7068702d766967656e6572652d636970686572) [![Packagist Download](https://camo.githubusercontent.com/a88ab17c39247faacfaaf6eef8d77ad0167a699a16355dfd7c7d75dd283d0a01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d63756c696e2f766967656e6572652d636970686572)](https://camo.githubusercontent.com/a88ab17c39247faacfaaf6eef8d77ad0167a699a16355dfd7c7d75dd283d0a01/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d63756c696e2f766967656e6572652d636970686572) [![Packagist Version](https://camo.githubusercontent.com/89e97947fafd1c32c2c66870d4f0440ec5dab66944606faa3414f6d650cfd3af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d63756c696e2f766967656e6572652d636970686572)](https://camo.githubusercontent.com/89e97947fafd1c32c2c66870d4f0440ec5dab66944606faa3414f6d650cfd3af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d63756c696e2f766967656e6572652d636970686572) [![Passed Build Workflow](https://camo.githubusercontent.com/6c7663472db79d4c28da7adc450c0f2e02cddf5ee039fa78703f0c59f8857d2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d63756c696e2f7068702d766967656e6572652d6369706865722f6275696c642e796d6c)](https://camo.githubusercontent.com/6c7663472db79d4c28da7adc450c0f2e02cddf5ee039fa78703f0c59f8857d2f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d63756c696e2f7068702d766967656e6572652d6369706865722f6275696c642e796d6c) [![Passed PHPStan Level 10](https://camo.githubusercontent.com/ba32bc6b26e6925a5a5d019f12800d337162c5aa58bfb95e5f28485941908800/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c5f31302d626c7565)](https://camo.githubusercontent.com/ba32bc6b26e6925a5a5d019f12800d337162c5aa58bfb95e5f28485941908800/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c5f31302d626c7565)

 [![Optimized with PHP CS Fixer](https://camo.githubusercontent.com/d9736de86b0a715ce590e7f16c6512f08f8664f665260e2439f3e7ca11ea4fb0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505f43535f46697865722d4f7074696d697a65642d677265656e)](https://camo.githubusercontent.com/d9736de86b0a715ce590e7f16c6512f08f8664f665260e2439f3e7ca11ea4fb0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505f43535f46697865722d4f7074696d697a65642d677265656e) [![Checked using Psalm](https://camo.githubusercontent.com/4e2f8ae9c32cf63b56da9ea49cc8b8cc2bb955e04a1d70173bcf7330d78bee33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d436865636b65642d677265656e)](https://camo.githubusercontent.com/4e2f8ae9c32cf63b56da9ea49cc8b8cc2bb955e04a1d70173bcf7330d78bee33/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5073616c6d2d436865636b65642d677265656e)

Encrypt/decrypt string using Vigenere Cipher algorithm

Instalation
-----------

[](#instalation)

```
composer require amculin/vigenere-cipher
```

How to use
----------

[](#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
--------

[](#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
-----

[](#todos)

- Add ASCII mode to support file encryption/decryption

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance69

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~59 days

Total

3

Last Release

319d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fe6825785ecfe0c1b9e700cc504d2bbe137891999ac22db1753547b2fbbcad7?d=identicon)[amculin](/maintainers/amculin)

---

Top Contributors

[![amculin](https://avatars.githubusercontent.com/u/4025450?v=4)](https://github.com/amculin "amculin (55 commits)")

---

Tags

classical-cryptographycryptographyphpphp82php83vigenere-cipherphpcryptographyencryptionencryptdecryptdecryptionvigenere cipherclassic cryptography

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/amculin-vigenere-cipher/health.svg)

```
[![Health](https://phpackages.com/badges/amculin-vigenere-cipher/health.svg)](https://phpackages.com/packages/amculin-vigenere-cipher)
```

###  Alternatives

[nzo/url-encryptor-bundle

The NzoUrlEncryptorBundle is a Symfony Bundle used to Encrypt and Decrypt data and variables in the Web application or passed through URL

961.0M2](/packages/nzo-url-encryptor-bundle)[poly-crypto/poly-crypto

High-level cryptographic functions that are interoperable between NodeJS and PHP 7.1+

127.8k1](/packages/poly-crypto-poly-crypto)[camcima/dukpt-php

DUKPT implementation in PHP

25153.1k](/packages/camcima-dukpt-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
