Skip to content

Instantly share code, notes, and snippets.

View EppuHeilimo's full-sized avatar

Eppu Heilimo EppuHeilimo

View GitHub Profile
@EppuHeilimo
EppuHeilimo / hill.py
Last active October 9, 2022 09:09
Hill cipher in python
import numpy as np
def encrypt(msg):
# Replace spaces with nothing
msg = msg.replace(" ", "")
# Ask for keyword and get encryption matrix
C = make_key()
# Append zero if the messsage isn't divisble by 2
len_check = len(msg) % 2 == 0