Skip to content
 
 

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Encryption and Decryption Using the Enigma Machine

The Enigma machine is a historical encryption device that uses rotors to encrypt and decrypt messages. This README explains the basics of how the Enigma machine works and provides examples of encryption and decryption using different configurations.

Overview

The Enigma machine employs a set of rotors to perform encryption. The rotors are arranged in a specific order, and each rotor can be rotated to change the encryption pattern. The basic steps of the encryption process involve substituting each letter of the plaintext message with a corresponding letter from the rotor configuration.

Getting Started

To use the Enigma machine for encryption and decryption, you'll need to compile and run the provided C code. Follow these steps:

  1. Compile the code using the following command:

    gcc -g enigma_functions.c enigma_driver.c -Wall
    
  2. Run the compiled executable:

    ./a.out
    

Encryption Process

  1. Choose the rotors you want to use for encryption and the order in which they will be applied.
  2. Specify the number of rotations to apply to the encryption rotors.
  3. Enter the message you want to encrypt.

The program will then perform the encryption and display the encrypted message.

Decryption Process

To decrypt a message that has been encrypted using the Enigma machine, simply follow the same steps as for encryption, but apply the rotors in reverse order. Use the same number of rotations for the decryption process as you used for encryption.

Example

Here's an example of using the Enigma machine for encryption and decryption:

Encryption

Message: COMPUTER
Rotors: 66
Rotations: 0

Encrypted message: MWHKCAZB

Decryption

Message: MWHKCAZB
Rotors: 66
Rotations: 0

Decrypted message: COMPUTER

Test Example

Enter the message to be encrypted or decrypted: COMPUTER SCIENCE
Which rotors will be used to encrypt the message: 24
Enter the number of rotations to apply to the encryption rotors: 5
The encrypted message is: NCLJMABF XNZBTNB
The decrypted message is: COMPUTER SCIENCE

About

The Enigma machine, known for its complexity and role in cryptography history, is simulated here for educational and illustrative purposes. The repository includes C code that demonstrates the basic principles of the Enigma machine, allowing users to experiment with different rotor configurations, rotations, and encryption/decryption processes.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages