Skip to content

An implementation of the Data Encryption Standard symmetric-key encryption algorithm.

Notifications You must be signed in to change notification settings

andrew-eldridge/data-encryption-standard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Encryption Standard Implementation

Python implementation of the Data Encryption Standard algorithm, completed as the final project for Math 587 - Introduction to Cryptography at USC. Group members: Weston Watts, Caroline Boozer, Ellis McLarty, Andrew Eldridge.

Encryption and decryption methods are exposed as REST API endpoints using the Flask-RESTful library.

Setup

Clone repo

git clone https://github.com/andrew-eldridge/data-encryption-standard.git

Open project directory

cd data-encryption-standard

Install required Python packages

pip install -r requirements.txt

Run API script (optional flag log for detailed output logs)

python des.py [-log]

Endpoints

Base address: 127.0.0.1:5000/api/v1

/key {GET}

Provides a random 64-bit key to be used for input in the encryption/decryption functions.

Request: N/A

Response:

{
  "key": "0111001000010100111110101000100101100100101001100110111001001011"
}

/encrypt {POST}

Encrypts given 64-bit (8 character plaintext) message with provided 64-bit (binary) key. Returns corresponding 64-bit (binary) cipher.

Request:

{
  "message": "hllowrld",
  "key": "1101010010111111010100111100011111000010010010110100110100000101"
}

Response:

{
  "cipher": "1101001011010011110110010001100011000010011000110110011100101111"
}

/decrypt {POST}

Decrypts given 64-bit (binary) cipher with provided 64-bit (binary) key. Returns corresponding 64-bit (8 character plaintext) message.

Request:

{
  "cipher": "1101001011010011110110010001100011000010011000110110011100101111",
  "key": "1101010010111111010100111100011111000010010010110100110100000101"
}

Response:

{
  "message": "hllowrld"
}

About

An implementation of the Data Encryption Standard symmetric-key encryption algorithm.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages