caesarcipher/caesarcipher

A PHP package for encoding, decoding and cracking the Caesar shift cipher

1.0.0 2014-10-06 01:56 UTC

This package is not auto-updated.

Last update: 2024-05-21 01:13:30 UTC


README

A PHP Port of Rob Spectre's Python Caesar Cipher library. Encode, decode and crack messages with Caesar Shift Cipher.

Build Status Coverage Status Total Downloads

Installation

You can install this library using composer

composer require caesarcipher/caesarcipher

Usage

Encoding a message with an offset:

$cipher = new CaesarCipher();
$message = "Brooklyn";
$cipher->encode($message,5);

Decoding a ciphertext with an offset:

$cipher = new CaesarCipher();
$message = "Uxjmjp";
$cipher->decode($message,5);

Cracking a ciphertext without knowing the offset:

$cipher = new CaesarCipher();
$cipher_text = "Bj qfhp ymj rtynts yt rtaj yt ymj sjb gjfy!";
$crack_text = $cipher->crack($cipher_text);