Generate decrypt request.

@param InputInterface  $input
@param OutputInterface $output

@return DecryptRequest
177827
private function generateDecryptRequest(InputInterface $input, OutputInterface $output)
    {
        $algorithmId = $input->getArgument('algorithm_id');
        $encryptedValue = $input->getArgument('encrypted_value');
        $key = $input->getOption('key');
        $keyProvided = $input->hasParameterOption(['--key', '-k']);

        $questionText = 'Encrypted value to be decrypted (hidden input): ';
        $encryptedAsker = $this->questionAskerGenerator
            ->generateHiddenInputQuestionAsker($questionText, $input, $output);

        return $this->decryptRequestFactory
            ->createDecryptRequest($algorithmId, $encryptedAsker, $encryptedValue, $key, $keyProvided);
    }
684681
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $questionHelper = $this->getQuestionHelper();

        if ($input->isInteractive()) {
            $question = new ConfirmationQuestion($questionHelper->getQuestion('Do you confirm generation', 'yes', '?'), true);
            if (!$questionHelper->ask($input, $output, $question)) {
                $output->writeln('<error>Command aborted</error>');

                return 1;
            }
        }

        $module = Validators::validateModuleName($input->getOption('module'));
        $entity = Validators::validateEntityName($input->getOption('entity'));
        list($bundle, $module) = $this->parseShortcutNotation($module);
        $module = substr($module, 0, -6);

        $questionHelper->writeSection($output, 'Module generation');

        $bundle = $this->getContainer()->get('kernel')->getBundle($bundle);

        /** @var ModuleGenerator $generator */
        $generator = $this->getGenerator(new ClasticGeneratorBundle());
        $generator->generate($bundle, $module, $entity);

        $output->writeln('Generating the module code: <info>OK</info>');

        $questionHelper->writeGeneratorSummary($output, array());

        return 0;
    }
659885
public function decryptWithKey(InputOutputInterface $cipherInputOutput, $recipientId, $privateKey)
    {
        try {
            return $this->cipher->decryptWithKey($cipherInputOutput->getInput(), $recipientId, $privateKey);
        } catch (Exception $exception) {
            throw new CipherException($exception->getMessage(), $exception->getCode());
        }
    }
1370699
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $path = $input->getArgument('path');

        $fileSystem = new FileSystem();
        $fileEditor = new FileEditor(new FileGenerator(), new FunctionRepository(), $fileSystem);

        foreach ($fileSystem->getFilesFromPath($path) as $file) {
            $fileEditor->addBackslashes($file);
        }

        $output->write('Success! Backslashes added!', true);

        return $output;
    }
809735
public static String decrypt(String input) {
        byte[] result = decrypt(input.getBytes());
        return new String(result);
    }
370118
public function run(InputInterface $input, OutputInterface $output): int
    {
        $command = (string) $input;
        $command = strtr($command, [
            ' -name' => ' -N',
            ' -type' => ' -T',
            ' -maxdepth' => ' -M',
            ' -delete' => ' -d true',
        ]);

        return parent::run(new StringInput($command), $output);
    }
227191
private function generateOutput(InputInterface $input): OutputInterface
    {
        return new Output(
            $this->name,
            array_merge(
                $this->evaluateInputExports($input),
                $this->generateOutputParams($input)
            )
        );
    }
306872
protected function execute(InputInterface $input, OutputInterface $output)
    {
        //  validate the content types unless validation is ignored

        if ($input->getArgument('id') && !$input->getOption('ignore')) {
            $code = $this->executeValidation($input, $output);

            if ($code) {
                return $code;
            }
        }

        if ($input->getOption('delete')) {
            return $this->executeDelete($input, $output);
        }

        if (!$input->getArgument('id') && !$input->getOption('full')) {
            throw new InvalidArgumentException(
                'You need to give one or more content types or choose the --full or --delete option'
            );
        }

        return $this->executeIndex($input, $output);
    }
411320
protected function execute(InputInterface $input, OutputInterface $output)
    {

        $serverHelper = new DetermineServer();

        $from = $input->getArgument('from');

        $fromServer = $serverHelper->getServerForCommand($from);
        $fromPath = $serverHelper->getPathForCommand($from);


        if(strpos($from, '@') === 0 ){
            exec('ssh '.$fromServer.' "cd '.$fromPath.' ; du -hs fileadmin"', $result);
            $output->writeln($result);
        }else {
            exec('du -sh '.$fromServer.'fileadmin', $result);
            $output->writeln($result);
        }


        return 0;
    }
218661
public function execute(InputInterface $input): OutputInterface
    {
        $this->validator->validateInput($this, $input);
        $output = $this->generateOutput($input);
        $this->validator->validateOutput($this, $output);
        return $output;
    }
28176
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->writeln('Generating package code...');

        $generator = new PackageGenerator();

        $definitions = new Definitions([
            'core' => 'https://raw.githubusercontent.com/schemaorg/schemaorg/master/data/schema.rdfa',
        ]);

        if (! $input->getOption('local')) {
            $definitions->preload();
        }

        $generator->generate($definitions);

        $output->writeln('Done!');

        return 0;
    }
809792
private function encryptBlock($input, $key)
    {
        if (!$input && !$key) {
            return '';
        }

        $this->prepareCipher($key);
        $result = mcrypt_generic($this->mcrypt, $input);
        mcrypt_generic_deinit($this->mcrypt);

        return $result;
    }
341480
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $errOutput = $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output;

        $curie = SchemaCurie::fromString($input->getArgument('curie'));
        $_SERVER['REQUEST_METHOD'] = 'POST';
        $_SERVER['CONTENT_TYPE'] = 'application/json';
        $_SERVER['HTTP_ACCEPT'] = 'application/json';
        $_SERVER['HTTP_ACCEPT_CHARSET'] = 'utf-8';
        $_SERVER['HTTP_USER_AGENT'] = $input->getOption('user-agent') ?: 'pbjx-console/0.x';

        $deviceView = $input->getOption('device-view');
        if (!empty($deviceView)) {
            $_SERVER['DEVICE_VIEW'] = $deviceView;
            putenv('DEVICE_VIEW=' . $deviceView);
        }

        $request = Request::create(
            sprintf(
                '/pbjx/%s/%s/%s/%s',
                $curie->getVendor(),
                $curie->getPackage(),
                $curie->getCategory() ?: '_',
                $curie->getMessage()
            ),
            $_SERVER['REQUEST_METHOD'],
            [], // GET and POST (aka $_REQUEST)
            $_COOKIE,
            $_FILES,
            $_SERVER,
            $input->getArgument('json') ?: '{}'
        );

        /*
         * prepare the request object so http and console processing are virtually the same
         */
        $request->setRequestFormat('json');
        $request->attributes->set('pbjx_vendor', $curie->getVendor());
        $request->attributes->set('pbjx_package', $curie->getPackage());
        $request->attributes->set('pbjx_category', $curie->getCategory());
        $request->attributes->set('pbjx_message', $curie->getMessage());
        $request->attributes->set('pbjx_bind_unrestricted', true);
        $request->attributes->set('pbjx_console', true);
        if (!empty($deviceView)) {
            $request->attributes->set('device_view', $deviceView);
        }

        $this->useInMemoryTransports($input);
        $this->getRequestStack()->push($request);
        $envelope = $this->getPbjxController()->handleAction($request);

        try {
            $this->getPbjx()->triggerLifecycle($envelope, false);
        } catch (\Throwable $e) {
            /*
             * write to std error but return payload as is.  Decorating the envelope
             * is not typically an exception worthy condition.
             */
            $errOutput->writeln('<error>' . $e->getMessage() . '</error>');
        }

        $envelope->set('ok', Code::OK === $envelope->get('code'));
        $output->writeln(json_encode($envelope, $input->getOption('pretty') ? JSON_PRETTY_PRINT : 0));
    }
604554
public function decrypt($input)
    {
        if (! $input) {
            return $input;
        }

        $methods = $this->getEncryptionMethods();
        if (':' == $input[0]) {
            list($empty, $mkey, $base64) = explode(':', $input, 3);

            if (! isset($methods[$mkey])) {
                $error = sprintf("Encryption method '%s' not defined in projec.ini.", $mkey);
                throw new \Gems_Exception_Coding($error);
            }

            $method = $methods[$mkey];
        } else {
            $mkey   = 'mcrypt';
            $base64 = $input;
            $method = $mkey;
        }

        $decoded = base64_decode($base64);
        if ('mcrypt' == $method) {
            $output = $this->decryptMcrypt($decoded);
        } elseif ('null' == $method) {
            $output = $base64;
        } else {
            $output = $this->decryptOpenSsl($decoded, $method);
        }

        if (false === $output) {
            return $input;
        } else {
            return $output;
        }
    }
490493
public static function encrypt($input, $secret = null) {
        // no input?
        if(!$input)
            return false;

        // encrypt
        $encrypted = Security::encrypt((string)$input, md5(self::secret($secret)));

        // output
        return self::base64encode($encrypted);
    }
331840
protected function execute(InputInterface $input, OutputInterface $output) {
        //Start by getting the security service reference
        $security = $this->getContainer()->get('mesd.jasper.report.security');

        //Process the input options
        $roles  = $input->getOption('roles')  ?: $security->getDefaultRoles();
        $backup = $input->getOption('backup') ? true : false;
        $path   = $input->getOption('path')   ?: $security->getSecurityFile();
        $depth  = intval($input->getOption('depth'))  ?: -1;

        //Init the security service (normally done automatically via the setRole and canView)
        $security->init();

        //Backup the existing file if the backup flag is set and the existing file exists
        if ($backup && $security->isLoadedFromFile()) {
            //change the existing path to add that it is a backup
            $currentPath = explode('/', $security->getSecurityFile());
            $currentPath[count($currentPath) - 1] = '~' . $currentPath[count($currentPath) - 1];
            $security->saveSecurityConfiguration(implode('/', $currentPath), true);
        }

        //Turn off security for the client for the time being
        $this->getContainer()->get('mesd.jasper.report.client')->setUseSecurity(false);

        //Convert the file structure to an array with the roles set
        $this->setResource($security, $security->getDefaultFolder(), $roles, $depth);

        //Save the security configuration
        $security->saveSecurityConfiguration($path, true);
    }
579477
protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $this->input  = $input;
        $this->output = $output;
        $this->io     = new SymfonyStyle($this->input, $this->output);

        return $this->go();
    }