Purchase Solution

Enigma Machine implementation in C

Not what you're looking for?

Ask Custom Question

Write a software implementation of a simple three rotor Enigma Machine. Please refer to the following wikipedia entries for the Enigma Machine and the Enigma Rotor details.

http://en.wikipedia.org/wiki/Enigma_machine
http://en.wikipedia.org/wiki/Enigma_rotor_details

For the current implementation, consider only the rotors I - V, and the stock B & C reflectors. For sake of convenience, our message format will contain everything including the settings, as explained below.

machine_settings ( reflector, left rotor, middle rotor, right rotor )
initial_position encrypted_message_indicator
message ( this may be more that one line )

For example :
B I II III
AAA AAA
ZZZZZ ZZZZZ ...

The initial position is where the rotors start, the encrypted message indicator is the input then, and the resulting values would be the message indicator. That indicator becomes the initial position for the message. Historically the message body was written as 4 or 5 letter groups.

Kindly refer to the attached document ("Enigma Machine.doc") for detailed explanation of encryption logic using examples.

Purchase this Solution

Solution Summary

Attached program compiles with 'gcc -Wall -ansi' without any errors and warnings (tested with gcc 3.3.1 on cygwin), and has been tested for inputs given in the document, with and without '-vvv' argument to the compiled program.

Solution Preview

Attached 152594.c compiles correctly with "gcc -Wall -ansi", and has ...

Purchase this Solution


Free BrainMass Quizzes
C# variables and classes

This quiz contains questions about C# classes and variables.

Basic Networking Questions

This quiz consists of some basic networking questions.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.