项目作者: julius383

项目描述 :
Re-implementation of linenoise/asemica a document based cipher
高级语言: Factor
项目地址: git://github.com/julius383/asemica-factor.git
创建时间: 2020-04-11T08:38:53Z
项目社区:https://github.com/julius383/asemica-factor

开源协议:

下载


Asemica

This is a re-implementation of asemica which is a cipher that uses a document as a key.
The original is written in Perl but this one uses the Factor programming anguage.

Usage

To use this program you need to first have Factor installed on your
system. Clone the repository and change into the directory. Then you can run it by invoking the factor-vm with asemica.factor and all the
necessary arguments for example on Arch Linux.

  1. $ echo "Attack at Dawn" | factor-vm asemica.factor -m enc -c metamorphosis.txt -o enc.txt
  2. $ cat enc.txt
  3. they must request a little way he didn't know just getting weaker
  4. and fur He began their skirts she fled onto her breast His bed
  5. perhaps expected said nothing unusual was something of luxury For the
  6. bedding was something of rain could think it had at all to sleeping a
  7. COPYRIGHTED
  8. $ factor-vm asemica.factor -m dec -c https://www.gutenberg.org/cache/epub/5200/pg5200.txt -i enc.txt
  9. Attack at Dawn

The above encodes the message from stdin “Attack at Dawn” and writes
the result to enc.txt. A file can be passed for the input and output
using -i and -o. Additionally the key file (-c argument) may be
a URL to an online file.

Practical Information

The program takes some time to start-up due to the loading of the various
libraries being used so it may be beneficial to
generate a custom image containing all the loaded libraries and
passing it as an argument. To do this run the following commands

  1. $ factor-vm -run=readline-listener
  2. IN: scratchpad USE: vocabs.loader
  3. IN: scratchpad "/path/to/repo/" add-vocab-root
  4. IN: scratchpad USE: asemica-factor
  5. IN: scratchpad "/some/path/cust.img" save-image-and-exit

Afterwards make sure to add -i=/some/path/cust.img to calls to the
factor vm. Alternatively you can add a shebang line to the top of
asemica.factor so you can run the program as a script. Running
without any arguments prints out the usage.

  1. asemica - a markov chain based cipher
  2. usage: asemica -m mode -c <file/url> [-i <file>] [-o <file>]
  3. Options:
  4. -m either 'enc' or 'dec' for encode or decode mode
  5. -c specify the corpus file or url
  6. -i specify the input file (defaults to STDIN)
  7. -o specify the output file (defaults to STDOUT)