Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

Playfair Cipher — Flask Web App

Project Structure

playfair_flask/
├── app.py              # Flask backend (Python Playfair cipher logic)
├── requirements.txt    # Dependencies
├── templates/
│   └── index.html      # Frontend (Terminal/Hacker aesthetic)
└── README.md

Setup & Run

1. Install Flask

pip install -r requirements.txt

2. Run the App

python app.py

3. Open Browser

http://127.0.0.1:5000

Flask API Endpoints

Endpoint Method Description
/ GET Main page
/encrypt POST Encrypt plaintext
/decrypt POST Decrypt ciphertext
/matrix POST Get 5x5 key matrix only

Example Request

POST /encrypt
{
  "text": "HIDE THE GOLD",
  "key": "MONARCHY"
}

Example Response

{
  "result": "BM OD ZB XD NA",
  "matrix": [["M","O","N","A","R"],["C","H","Y","B","D"],...],
  "digraphs": ["HI","DE","TH","EG","OL","DX"]
}

How Playfair Works

  1. Build 5x5 matrix from key (I/J merged)
  2. Split plaintext into digraphs (letter pairs)
  3. If same row → shift right
  4. If same column → shift down
  5. If rectangle → swap corners

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages