Coder Social home page Coder Social logo

oilulio / classicalciphers Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 109 KB

Various classical ciphers and encodings in Java

Java 98.82% Batchfile 0.60% Shell 0.57%
classical-cryptography adfgvx enigma-cipher sigaba vigenere-cipher cryptography

classicalciphers's Introduction

A set of encodings and Classical Ciphers implemented in Java

The main() method of most ciphers runs a test module to confirm the cipher is returning an expected value. ClassicalCipher provides standard test modules (e.g. provide matching PT,CT pair and checks encrypt and decrypt) Test methods can be awkward for non-fully specified classical ciphers, e.g. where unknown nulls are added.

Ciphers usually have toString() methods that show their type, codespace and specific key.

Base classes are Encoding and ClassicalCipher. Provide foundation methods and structure.

Two key helper classes are Codespace and Keyword.

Codespace provides helper functions and defines the plain text alphabet that may be presented to the cipher (e.g. capital letters only); the letters the Cipher recognises at input; and the mappings between the plan text and these letters. The reverse applies at output.

As an example, many classical ciphers using a square to define their transpositions can only utilise 25 characters of the alphabet (because 25 is a square). There are common ways of mapping the alphabet to these 25 letters, such as combining I & J. At output, no Js exist and cannot be directly reconstituted โ€“ the reader is assumed to cope.

Of more recent devices, Sigaba used a mapping whereby at input all original Zs were converted to Xs and a space was converted to an Z. When decoded these Zs were presented as spaces, but the original X & Z were both shown as X. This a a consequence of overloading 27 symbols onto 26.

Most of the ciphers use Codespace to define their domain, sometimes with multiple possibilities as defined at instantiation and other times in a defined way as that is intrinsic to the definition of the cipher.

Keyword is itself a subclass of a Monoalphabetic cipher. Its subclasses each deal with the multiple ways that a keyword can be used to key certain classical ciphers. For instance, a common method was to write the keyword with the rest of the alphabet appended in alphabetic order and used these 26 characters as a monoalphabetic substitution against the 26 normally ordered letters of the alphabet.

classicalciphers's People

Contributors

oilulio avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.