def/cipher

Caesar cipher and others


Keywords
cipher, Caesar cipher, linear cipher
License
MIT

Documentation

def-cipher

Build Status Latest Stable Vesrion

use def\Cipher\CaesarCipher;
use def\Cipher\Alphabet\EnglishAlphabet;

$rot13 = new CaesarCipher(new EnglishAlphabet, 13);

print $rot13->encode("Hello, world\n");

or

use def\Cipher\VigenereCipher;
use def\Cipher\Alphabet\EnglishAlphabet;

$cipher = new VigenereCipher(new EnglishAlphabet, "keyword");

print $cipher->encode("Hello, world\n");