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; }
public function testGetRange() { $this->assertEquals('d4a4ae', $this->key->getRange(2, 3)->hex()); }
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; }