Skip to content

Instantly share code, notes, and snippets.

View aejunior's full-sized avatar
🎯
Concentrando

Junior aejunior

🎯
Concentrando
View GitHub Profile
@aejunior
aejunior / hill.py
Created December 13, 2023 02:43
Cifra de Hill
import numpy as np
word = 'UFOPA'.upper()
key = np.array([[2, 1], [-1, 4]]) # Chave de criptografia
len_alphbt = 26
cod_letters = [ord(char) - ord('A') + 1 for char in word]
if len(word) % 2 != 0: cod_letters = cod_letters + [len_alphbt] # Completando com Z.
"""
Criptografando a mensagem