HEX
Server: Apache/2.4.65 (Debian)
System: Linux srv39710 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64
User: root (0)
PHP: 8.4.11
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
Upload Files
File: //opt/bitninja-dispatcher/node_modules/.bin/ebg
#!/usr/bin/env node

const rot13 = require('../index');
const keys = require('../keys/index');
const argv = require('minimist')(process.argv.slice(2));
const chalk = require('chalk');
const cowsay = require('cowsay');

if (argv['generate-keys']) {
  const seed = argv.seed;
  console.log(keys.generate(seed));
  process.exit();
}

if (!argv._.length) {
  const usageMessage = `
Usage: ebg13 [--generate-keys] [--seed seed] [--key key] message1 [message2 [...]]
  
  --generate-keys - Generages a pair of assymetric keys to be used for encoding/deconding
  --seed seed - uses the seed as the private key and calculates a public key from it
  --key key - [optional] encoding/decoding key (it defaults to 13)
  message1, message2, ... - a list of at least one message to be encoded/decoded

A non empty list og messages is required for encoding/decoding but is
not necessary when generating keys.
  `;

  console.log(cowsay.say({
    text: usageMessage,
  }));

  process.exit(-1);
}

const key = argv.key || 13;
const encodedMessages = argv._.map(message => rot13(message, key));

encodedMessages.forEach(message => console.log(chalk.yellow(message)));