コード例 #1
0
 public function retrieve($a, $b)
 {
     $pos = strpos($this->plaintext_key, $b);
     $key = $this->getSubstitutionTableEntry($pos);
     $table = new SimpleCipher($this->plaintext_key, $key);
     return $table->decrypt($a);
 }
コード例 #2
0
 /**
  * Reset the substitution table to original form
  *
  * @return $this
  */
 protected function _reset()
 {
     parent::_reset();
     $this->substitution_table->setSubstitutions(array(str_split(strrev($this->substitution_table->getPlaintextKey()))));
     return $this;
 }
コード例 #3
0
 /**
  * Reset the substitution table to its original form
  *
  * @return $this
  */
 protected function _reset()
 {
     parent::_reset();
     $this->substitution_table->setSubstitutions(array(str_split(Helper::rotate($this->substitution_table->getPlaintextKey(), $this->rotation_value - 1))));
     return $this;
 }