Skip to content

Vigenère Cipher + Enigma Machine for Text Encryption.

License

Notifications You must be signed in to change notification settings

tranhlok/obfuscate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Obfuscate

This application replicates the following text encryption processes:

More encryption methods will be added in the future.

Installation

  1. Clone the Repository

    To get started, clone this repository to your local machine using the following command:

git clone https://github.com/tranhlok/obfuscate.git
cd obfuscate
  1. Set Up a Virtual Environment (optional but recommended)

Create a new virtual environment by running

python3 -m venv venv

Activate the virtual environment:

  • On Windows:
    .\venv\Scripts\activate
  • On macOS and Linux:
    source venv/bin/activate
  1. Install Dependencies

Install the required Python packages with pip:

pip install -r requirements.txt

Using the Application

Run the application:

python run.py

Using the GUI

Select the encryption technique from the dropdown menu.

If Vigenère is Selected:

  • Enter the first key (a keyword) in the "First Key" field.
  • Enter the second key (a keyword) in the "Second Key" field.
  • Enter the passage you want to encrypt or decrypt in the "Passage" field.
  • Click "Encrypt" to encrypt the passage or "Decrypt" to decrypt the passage.
  • The results will be displayed in the "Result" field, along with the generated alphabet and lines used for the Vigenere cipher. All output can be select and copy.

If Enigma is Selected:

  • Enter the settings and passage.
  • The encrypt/decrypt is the same due to the natural of the machine

Test Run for Vigenère

Kryptos K1

  • Keywords: KRYPTOS and PALIMPSEST

  • Encrypted Text

EMUFPHZLRFAXYUSDJKZLDKRNSHGNFIVJ
YQTQUXQBQVYUVLLTREVJYQTMKYRDMFD
  • Decrypted Text
BETWEENSUBTLESHADINGANDTHEABSENCEOFLIGHTLIESTHENUANCEOFIQLUSION
  • Decrypted Text With Spaces
BETWEEN SUBTLE SHADING AND THE ABSENCE OF LIGHT LIES THE NUANCE OF IQLUSION

Kryptos K2

  • Keywords: KRYPTOS and ABSCISSA

  • Encrypted Text

VFPJUDEEHZWETZYVGWHKKQETGFQJNCE
GGWHKK?DQMCPFQZDQMMIAGPFXHQRLG
TIMVMZJANQLVKQEDAGDVFRPJUNGEUNA
QZGZLECGYUXUEENJTBJLBQCRTBJDFHRR
YIZETKZEMVDUFKSJHKFWHKUWQLSZFTI
HHDDDUVH?DWKBFUFPWNTDFIYCUQZERE
EVLDKFEZMOQQJLTTUGSYQPFEUNLAVIDX
FLGGTEZ?FKZBSFDQVGOGIPUFXHHDRKF
FHQNTGPUAECNUVPDJMQCLQUMUNEDFQ
ELZZVRRGKFFVOEEXBDMVPNFQXEZLGRE
DNQFMPNZGLFLPMRJQYALMGNUVPDXVKP
DQUMEBEDMHDAFMJGZNUPLGEWJLLAETG
  • Decrypted Text
ITWASTOTALLYINVISIBLEHOWSTHATPOSSIBLETHEYUSEDTHEEARTHSMAGNETICFIELDXTHE 
INFORMATIONWASGATHEREDANDTRANSMITTEDUNDERGRUUNDTOANUNKNOWNLOCATIONXDOES
LANGLEYKNOWABOUTTHISTHEYSHOULDITSBURIEDOUTTHERESOMEWHEREXWHOKNOWSTHEEXACT
LOCATIONONLYWWTHISWASHISLASTMESSAGEXTHIRTYEIGHTDEGREESFIFTYSEVENMINUTES
SIXPOINTFIVESECONDSNORTHSEVENTYSEVENDEGREESEIGHTMINUTESFORTYFOURSECONDSWEST
IDBYROWS
  • Decrypted Text With Spaces and Symbols
IT WAS TOTALLY INVISIBLE HOW'S THAT POSSIBLE?
THEY USED THE EARTH'S MAGNETIC FIELD. THE INFORMATION WAS GATHERED AND TRANSMITTED UNDERGROUND TO AN UNKNOWN LOCATION.
DOES LANGLEY KNOW ABOUT THIS? THEY SHOULD. IT'S BURIED OUT THERE SOMEWHERE. WHO KNOWS THE EXACT LOCATION? ONLY W.W. THIS WAS HIS LAST MESSAGE:
THIRTY-EIGHT DEGREES FIFTY-SEVEN MINUTES SIX POINT FIVE SECONDS NORTH, SEVENTY-SEVEN DEGREES EIGHT MINUTES FORTY-FOUR SECONDS WEST. ID BY ROWS.
## Test Run for Enigma ``` rotors: I II III reflector: UKW-B ringSettings: ABC ringPositions: DEF plugboard: AT BS DE FM IR KN LZ OW PV XY ``` - Encrypted Text ``` DRTLLAANCZJLGZMICXSYRBNTNLLYGOXEABJPZHPOBLWMYJOWDCVHXYWRBAHGLWPUHKYQEVZVNNP``` ``` - Decrypted Text ``` UNDERNEATHTHESURFACEHIDDENTRUTHSLINGERAWAITINGTHOSEBRAVEENOUGHTOUNCOVERTHEM ``` - Decrypted Text With Spaces ``` UNDERNEATH THE SURFACE HIDDEN TRUTHS LINGER AWAITING THOSE BRAVE ENOUGH TO UNCOVER THEM ```

Folder Structure

vigenere_cipher_app/
├── encryption_methods/        # Directory containing different encryption method modules
│   ├── __init__.py           
│   ├── vigenere/              # Directory for the Vigenere cipher implementation
│   │   ├── __init__.py        
│   │   ├── vigenere.py        # Vigenere cipher logic (encryption, decryption, and helpers)
│   └── enigma/                # Directory for the Enigma Machine implementation
│       ├── __init__.py       
│       ├── enigma.py          # Logic for Enigma Machine
├── app/                       # Directory for the main application code
│   ├── __init__.py            
│   ├── main.py                # Main entry point for the PyQt5 application
├── fig/                       # Directory for additional supporting figures            
├── README.md                  # Documentation for the project
├── requirements.txt           # Lists all Python dependencies
└── run.py                     # Script to run the application

Resources


 (                                     
 )\ )             *   )                
(()/(           ` )  /((      )        
 /(_)) (    (    ( )(_))(  ( /(  (     
(_))   )\   )\  (_(_()|()\ )(_)) )\ )  
| |   ((_) ((_) |_   _|((_|(_)_ _(_/(  
| |__/ _ \/ _|    | | | '_/ _` | ' \)) 
|____\___/\__|    |_| |_| \__,_|_||_|  
                                       
                                                                                                                                                         

About

Vigenère Cipher + Enigma Machine for Text Encryption.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages