def/cipher

Caesar cipher and others

dev-master 2016-08-29 18:05 UTC

This package is auto-updated.

Last update: 2024-11-29 04:46:58 UTC


README

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");