protected function encodeKey(Buffer $key, $enc = null)
    {
        if ("hex" === $enc || (int) $enc == 16) {
            return $key->getHex();
        }
        elseif ("uint8" === $enc || (int) $enc == 8) {
            return $key->toUInt8();
        }
        elseif ("int32" === $enc || (int) $enc == 32) {
            $encoder = new Encoder;
            return $encoder->ua2words($key->toUInt8());
        }

        return $key;
    }