caesarcipher / caesarcipher
A PHP package for encoding, decoding and cracking the Caesar shift cipher
Installs: 1 299
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 2
Open Issues: 0
Requires
- php: >=5.3.0
Requires (Dev)
- satooshi/php-coveralls: dev-master
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.
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);