The Goals We Have Met


The listings of the 'programs.p' should be used in conjunction with this index of all programs, their input/output requirements and their authors.
These programs are released under the GNU General Public Licence and may be used in other projects under the terms of the GPL.
Mono-alphabetic Substitutions
Definition of substitution
Where each letter of plaintext is mapped to a unique letter in the ciphertext. This takes the form of either:
  • Cæsar cipher (ie "Shift by 3" rule)
  • "Random" mapping of each letter to another

Programs to attack a substitution
  • Cæsar cipher program to translate given the most frequent letter of the cipher

    ShiftFreq.p by Brett Avery
    Input:
    • standard input(redirected <) of the most frequent letter
    • infile - containing the text to be translated
    Output:
    • standard output(screen or redirected >) of prompts
    • outfile - contains translated text

  • Progresses through each of the 26 Cæsar cipher keys or until the user selects one as being the correct cipher

    caesar_n.p by Stuart Prescott
    Input:
    • standard input(keyboard) key
    • infile - containing text to be translated
    Output:
    • standard output(screen) translated text
    • outfile - contains text which has been translated

  • A monoalphabetic substitution program which applies a given substitution table to the given text. The user is given the option not to encrypt HTML tags (ie text between < and >)

    substHTML.p by Stuart Prescott
    Input:
    • standard input(keyboard) of menu
    • infile - containing text to be translated
    • substtable - containing the substitution table. Comments may be made in substtable using braces ({comment}). Unknown letters may be signified using a question mark ('?'). Such unknowns will be arbitrary allocated an unused letter. This is denoted in the text by a capital letter.
    Output:
    • standard output(screen) of menu and messaging
    • outfile - contains text which has been translated

  • Performs a letter frequency analysis of the given text. This program is combined with a comparison to 'standard' English frequencies and formulates a possible substitution table based on this comparison.

    freq.p by Stuart Prescott
    Input:
    • standard input(redirected <) - menu prompts
    • engfreq - standard English frequencies
    • infile - the file to be analysed
    Output:
    • standard output(screen) of letters sorted by frequency giving the absolute frequency, the percentage frequency and the possible plaintext equivalents.
    • substtable - possible substitution table sorted by letter frequency

  • A program which finds all the 2 lettered words in a piece of text. This assists in formulating a substitution table.

    2letter.p by Stuart Prescott
    Input:
    • infile - the file to be analysed
    Output:
    • nletterwords - contains each 2 lettered word in the text and (if it occurs more than once) its frequency

  • A program to find all digrams (2-letter combinations) or trigrams etc in a piece of text. This prog may also be used to find all n-lettered-words in a piece of text.

    string.p by Michael Shuter
    Input:
    • standard input(redirected <) user info
    • infile - the file to be analysed
    Output:
    • standard output(screen or redirected >) of user info
    • outfile - analysis details

  • A program to find all digrams (2-letter combinations) or trigrams etc in a piece of text.

    stringDist.p by Jack Dermody
    Input:
    • infile - the length of the analysis string and the file to be analysed
    Output:
    • standard output(screen or redirected >) of digrams and frequencies.



The Vigenére Cipher
Definition of the Vigenére Cipher
Provided with a keyword of length n, the algorithm uses n different Cæsar ciphers for each of the letter positions 1...n. This is illustrated below using the key hello:

Plain-text: the quick brown fox jumped
Keystream: hel lohel lohel loh ellohe
Cipher-text: bmq chqhw ngwbz rdf ogyemi

Programs to attack a Vigenére cipher
  • Encryption using Vigenére keys of any length

    encipvig.p by David Grogan
    Input:
    • standard output(screen) of the user info.
    • infile - the text to be encrypted
    Output:
    • standard output(screen) of the user info
    • outfile - the encrypted text

  • Decryption using Vigenére keys of any length

    vigdecip.p by David Grogan
    Input:
    • standard output(screen) of the user info.
    • infile - the text to be decrypted
    Output:
    • standard output(screen or redirected >) of the user info
    • outfile - the decrypted text

  • Find the length n of the Vigenére key using The Index of Coincidence.

    vig.p by David Grogan
    Input:
    • infile - the text to be analysed
    Output:
    • standard output(screen or redirected >) of the indices of coincidence.

  • Performs a letter frequency analysis of every nth letter (for n = 1...26) . This will find the length of the Vigenére key. This program is combined with a comparison to 'standard' English frequencies.

    freq_var_n.p by Stuart Prescott
    Input:
    • standard input(redirected <) - menu prompts
    • engfreq - standard English frequencies
    • infile - of the file to be analysed
    Output:
    • standard output(screen) of letters sorted by frequency giving the actual freq, the %freq and the possible plaintext equivalents
    • substtable - substitution table(s) sorted by letter freq
    • summary - a summary of each of the nth letter analyses and their rating

  • Performs a letter frequency analysis of every nth letter for a given n and starting position in the text. This will find the length of the Vigenére key. This program is combined with a comparison to 'standard' English frequencies.

    freq_n.p by Stuart Prescott
    Input:
    • standard input(redirected <) - menu prompts
    • engfreq - standard English frequencies
    • infile - of the file to be analysed
    Output:
    • standard output(screen) of letters sorted by frequency giving the absolute frequency, the percentage frequency and the possible plaintext equivalents
    • substtable - substitution table sorted by letter freq

  • Performs a letter frequency analysis of every nth letter for a given n and each starting position 1...n in the text. This information is then used to find the Vigenére key.

    freq_const_n.p by Stuart Prescott
    Input:
    • standard input(redirected <) - menu prompts
    • infile - of the file to be analysed
    Output:
    • standard output(screen) of Vigenére Key.

  • A script to link all these packages for cracking Vigenére encryption

    vigenere by Stuart Prescott
    Input:
    • standard input(keyboard or redirected <) of menu responses
    • whatever file(s) are to be analysed
    Output:
    • standard output(screen or redirected >) of menus.
    • whatever file is the product of the cracking


Rotations
Definition of the Rotation
Provided with a Rotation function ( R(x), where x is the position of the letter within the document), the algorithm uses a number (dependent on R(x) ) of different Cæsar ciphers in the same manner as the Vigenére cipher.

The rotation (in its simplest form) is R(x) = x. This is effectively a Vigenére cipher with a keystream of abcdefg...xyz.

In more complex forms the Rotation function may be a polynomial or a Fibonacci relation. The general form of a Fibonacci relation is:

R(x) = a(R(x - m)) + b(R(x - n))

where:
x is the position of the letter within the document
a, b, m, n are constants

Programs to attack a Rotation
  • Encryption/Decryption using a Linear Rotation function
    R(x) = ax
    (Use a to encode, -a to decode)

    rotation.p by Chris Boshuizen
    Input:
    • standard input(screen or redirected <) of the Rotation coefficient
    • infile - the text to be translated
    Output:
    • standard output(screen or redirected >) of prompts
    • outfile - the translated text

  • Encryption/Decryption using a Fibonacci Rotation function
    R(x) = a(R(x - 1) + R(x - 2))
    where: R(1) = R(2) = 1.
    (Use a to encode, -a to decode)

    fibonacci.p by Chris Boshuizen
    Input:
    • standard input(keyboard) of the rotation coefficient
    • infile - the file to be translated
    Output:
    • standard output(screen) of prompts
    • outfile - the translated text.
  • A script to link all these packages for Rotations

    rotations.men by Chris Boshuizen and Jack Dermody
    Input:
    • standard input(keyboard or redirected <) of menu responses
    • whatever file(s) are to be analysed
    Output:
    • standard output(screen or redirected >) of menus.
    • whatever file is the product of the cracking

AutoKey Encryption
Definition of AutoKey Encryption
The AuotKey method of encryption uses a key (of length n) for the first n letters of the cipher. After that the actual cipher-text itself is used as the key (hence the terminology auto-key. The Key is applied in the same manner as the Vigené key.
Programs to implement an AutoKey cipher
  • Encryption/Decryption using an AutoKey cipher
    AutoKey.p by Brett Avery
    Input:
    • standard input (keyboard or redirected <) of the Key.
    • infile - the text to be encrypted
    Output:
    • standard output(screen or redirected >) of the user info
    • outfile - the encrypted text


SkyTail Cipher
Definition of the SkyTail cipher
The text is translated from columns of characters to rows of characters and then broken up into words.

Programs to implement a SkyTail cipher
  • Encryption using the SkyTail cipher

    encipsky.p by David Grogan
    Input:
    • infile - the text to be encrypted
    Output:
    • standard output(screen or redirected >) of the user info
    • outfile - the encrypted text

  • Decryption using the SkyTail cipher

    decipsky.p by David Grogan
    Input:
    • infile - the text to be decrypted
    Output:
    • standard output(screen or redirected >) of the user info
    • outfile - the decrypted text

  • A script to link all these packages for SkyTail ciphers

    skytail by Jack Dermody
    Input:
    • standard input(keyboard or redirected <) of menu responses
    • whatever file(s) are to be translated
    Output:
    • standard output(screen or redirected >) of menus.
    • whatever file is the product of the translation

Enigma Encryption
Definition of the Enigma Variations (not Elgar's . . .)
The Enigma encryption methods were developed during the 19th century. The German implementation of this system in WWII consisted of an electro-mechanical machine which allowed the user to type in the message on a keyboard and the translated text was then written out.

The machine used 3 rotors which had the numbers 1..26 on them. These wheels turned the same way the wheels on an odometer turn (ie each time the first wheel completes a revolution, the next wheels moves round one place . . .)

A monoalphabetic substitution was also placed over the text.

This variation allows the user to set up 4 wheels (the last one is only useful on very long documents) where the numbers on the wheels are in any order and may be repeated.

Programs to crack the Enigma encryption
  • Encryption/Decryption using the Enigma Variations (without the substitution - see Monoalphabetic Substitutions)
    Allowing the user to choose whether or not to operate on HTML tags.

    enigma.p by Stuart Prescott
    Input:
    • standard input(keyboard or redirected <) of menu
    • infile - the text to be encrypted
    • enigmawheels - four rows of 26 numbers for the wheels
    Output:
    • standard output(screen or redirected >) of prompts
    • outfile - the encrypted text

  • Encryption/Decryption using a different Enigma Variations (without the substitution - see Monoalphabetic Substitutions)
    Allowing the user to choose whether or not to operate on HTML tags.

    enigvar.p by Michael Shuter
    Input:
    • standard input(keyboard or redirected <) of menu
    • infile - the text to be encrypted
    • wheeldata - up to 400 numbers for the wheels
    Output:
    • standard output(screen or redirected >) of prompts
    • outfile - the encrypted text

  • Decrypting/Encrypting/Solving the unsubstituted Enigma.

    solenig.p by Michael Shuter
    Input:
    • standard input (keyboard) of wheel refinements.
    • infile - the text to be decrypted
    • wheeldata - contains the information on the contents of the wheels
    Output:
    • standard output(screen or redirected >) of the user info
    • outfile - the (partially)decrypted text

  • A script to implement a full Enigma Encryption (ie Substitution, Enigma, Substitution)

    SES by Stuart Prescott
    Input:
    • standard input(keyboard or redirected <) of menu responses
    • enigmawheels - four rows of 26 numbers for the wheels
    • substtable1 - 1st letter substitution table
    • subattable2 - 2nd letter substitution table
    • whatever file(s) are to be translated
    Output:
    • standard output(screen or redirected >) of menus.
    • whatever file is the product of the translation
    • enigmasummary - summary log of the process

Plain-Text Attacks
Definition of the Plain-Text Attack
A plain text attack on a piece of cipher-text consists of looking for parts of the text which may be assumed. Such parts are often names, headings, equations, salutaions or dates.

Programs to implement a plain-text attack
  • Finds the numerical difference between guessed and encrypted text.

    diffe.p by Michael Shuter
    Input:
    • standard input (keyboard or redirected <) of menu
    • infile1 - the text to be compared
    • infile2 - the text to be compared
    Output:
    • outfile - the letter differences



Written by Stuart Prescott for and on behalf of the group of
Brett Avery
Christopher Boshuizen
Jack Dermody
David Grogan
Stuart Prescott
Michael Shuter

Copyright © MCMXCVI Stuart Prescott

Last edited: Friday June 25, 2004

Valid XHTML 1.1 Valid CSS 2