コード例 #1
0
ファイル: Book.php プロジェクト: atelierspierrot/cryptography
 /**
  * Debugging the substitution table
  *
  * @return string
  */
 public function substitutionTableToString()
 {
     $ciphers = $this->substitution_table->getSubstitutions();
     return Helper::tableToString($ciphers, array(), array(), __CLASS__ . ' Encryption Table');
 }
コード例 #2
0
 /**
  * Debugging the substitutions table
  *
  * @return string
  */
 public function substitutionTableToString()
 {
     return Helper::tableToString($this->substitutions, str_split($this->plaintext_key), array(), get_class($this) . ' :: Substitution Table');
 }
コード例 #3
0
 /**
  * Debugging
  *
  * @return string
  */
 public function substitutionTableToString()
 {
     return Helper::tableToString($this->getSubstitutionTable(), array(), array(), '"Tabula Recta" Table');
 }
コード例 #4
0
 /**
  * Debugging the substitution table
  *
  * @return string
  */
 public function substitutionTableToString()
 {
     $ciphers = $this->substitution_table->getSubstitutions();
     $ciphers = $ciphers[0];
     foreach ($ciphers as $i => $list) {
         $ciphers[$i] = implode('-', $list);
     }
     return Helper::tableToString($ciphers, $this->substitution_table->getPlaintextKey(), array(), __CLASS__ . ' Encryption Table');
 }
コード例 #5
0
 /**
  * Debugging the substitution table
  *
  * @return string
  */
 public function substitutionTableToString()
 {
     $this->_reset();
     $ptk = $this->substitution_table->getPlaintextKey();
     $r = array();
     for ($i = 0; $i < floor(strlen($ptk) / $this->frequency); $i++) {
         if ($i > 0) {
             $this->substitution_table->rotate();
         }
         $ciphers = $this->substitution_table->getSubstitutions();
         $r[] = str_split($ciphers[0]);
     }
     return Helper::tableToString($r, str_split($ptk), array(), __CLASS__ . ' Encryption Table');
 }