public function encrypt($data, $key = null, $encode = true)
    {
        if (null !== $key) {
            $this->getContainer()->setKey($key);
        }

        $data = $this->getContainer()->encrypt($data);

        if (true === $encode) {
            $data = $this->encode($data);
        }

        return $data;
    }