<?php
class tsfs
{
	function entsfs($text)
	{
		$transposition = new transposition();
		$substitution = new substitution();
		$folding = new folding();
		$shifting = new shifting();

		$key = 'kode';
		$panjangkey = strlen($key);
		$output1 = $transposition->transpositionEncryption($text, $key, 'ORA');
		//$output2 = $substitution->substitutionEncryption($output1);
		$output2 = $folding->Cipher($output1);
		$output3 = $shifting->shiftingEncryption($output2, $panjangkey);
		return $output3;
	}

	function detsfs($text)
	{
		$transposition = new transposition();
		$substitution = new substitution();
		$folding = new folding();
		$shifting = new shifting();

		$key = 'kode';
		$panjangkey = strlen($key);
		$output1 = $shifting->shiftingDecryption($text, $panjangkey);
		$output2 = $folding->Decipher($output1);
		//$output3 = $substitution->substitutionDecryption($output2);
		$output3 = $transposition->transpositionDecryption($output2, $key);
		$plainTSFS = str_replace('ORA', '', $output3);
		return $plainTSFS;
	}
}