/hill-cipher

This repository contains a Python implementation of the Hill Cipher encryption algorithm using the NumPy library. The Hill Cipher is a polygraphic substitution cipher that encrypts messages by dividing them into blocks and then performing mathematical operations on those blocks.

Primary LanguagePython

Hill Cipher

The Hill Cipher is a polygraphic substitution cipher that uses matrix algebra to encrypt and decrypt messages. This implementation of the Hill Cipher in Python uses the NumPy library to perform matrix operations.

Installation

  1. Clone the GitHub repository:
git clone https://github.com/Jawabreh0/hill-cipher
  1. Install NumPy:
pip install numpy

##Usage To encrypt a message using the Hill Cipher, run hill-cipher.py:

python hill-cipher.py

You will be prompted to enter a 2x2 matrix key and a message to encrypt. The encrypted message will be printed to the console.

Examples

Here are some examples of using the Hill Cipher:

Encrypt the message "HELLO" with the key [2 5; 1 3]:

Please enter the key as a 2x2 matrix (e.g. '2 5 1 3' for [2 5; 1 3]):
2 3 3 6
Please enter the message: GOLD
Encrypted message: CYFZ