PHPackages                             elegasoft/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. elegasoft/cipher

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

elegasoft/cipher
================

A keyless version of the Vigenère Cipher

v0.4.2(2y ago)038MITPHPPHP ^8.1

Since Jan 7Pushed 2y ago1 watchersCompare

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

READMEChangelogDependencies (7)Versions (16)Used By (0)

A Cipher Package for PHP
========================

[](#a-cipher-package-for-php)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a4615c85f8e3fd90f962d6d289dd6af1fc84cd4689c0bc83d0bd66cf6e0c72d0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c656761736f66742f6369706865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegasoft/cipher)[![Total Downloads](https://camo.githubusercontent.com/c67d5dfc386164366fe4087b3ae27c8aa57c26b3840600cd170083154c7fc72a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c656761736f66742f6369706865722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elegasoft/cipher)[![GitHub Actions](https://github.com/elegasoft/cipher/actions/workflows/main.yml/badge.svg)](https://github.com/elegasoft/cipher/actions/workflows/main.yml/badge.svg)

This is a Polyalphanumeric Cipher which great for obfuscating plain text from both casual and not so casual on lookers, but it should not be used as an alternative to using strong encryption for sensitive data.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require elegasoft/cipher
```

Basic Usage
-----------

[](#basic-usage)

```
// It only encodes characters in its character base
$cipher = new Base62Cipher(config('cipher.keys.base62'));
$cipher->encipher('hide-this-string-1111');
// returns 39O8-RBeX-4ZyGD6-o8pR
$cipher->decipher('39O8-RBeX-4ZyGD6-o8pR');
// returns hide-this-message

// It can encipher symbols in its character base
$cipher = new Base96Cipher(config('cipher.keys.base96'));
$cipher->encipher('hide-this-string-1111');
// returns (3]QC+2}SsoHzRz14Idecipher('(3]QC+2}SsoHzRz14I
