Exemple #1
0
 public function setKey(Key $key)
 {
     if ($key->getLength() == 16) {
         $byte = new Byte(24);
         $byte->set($key->get() . $key->getRange(0, 8));
         $key = new Key($byte);
     }
     $this->key = $key;
     return $this;
 }
Exemple #2
0
 public function testGetRange()
 {
     $this->assertEquals('d4a4ae', $this->key->getRange(2, 3)->hex());
 }
Exemple #3
0
 private function setSessionKey(ServerMessage\Request\Login $login)
 {
     $session_key = new Key($this->config->getDesKey());
     $session_key->setDesKey(ByteFactory::create($login->getPassword()));
     $this->cipher->setKey($session_key);
     return $this;
 }