code: private function createKey(string $key = null): Key
      {
          if (null === $key) {
              $key = $this->key;
          }
  
          if (null === $key) {
              throw new LogicException('Cipher secret key is not defined.');
          }
  
          $key = Key::loadFromAsciiSafeString($key);
  
          return $key;
      }
docs: Create key
  
  @param string $key
  @return \Defuse\Crypto\Key
  @throws \LogicException If the key is not defined