Introduction to the Hill Cipher


< change language

The Hill cipher is a very simple cipher that works by using modular arithmetic and matrices.

In a nutshell, your key is a matrix in some $\mathbb{Z}_m$ and you encrypt messages by breaking them up into pieces and then multiplying the pieces by the key matrix. That's it.

I will be giving a workshop on this subject in a near future, and so I decided to write a Python notebook with a brief explanation of how the Hill cipher works, as well as providing an implementation of said cipher. The notebook can be downloaded and read here. I will be glad if you leave any suggestions/comments in the section below!
A cifra de Hill é uma cifra simples que faz uso de noções de aritmética modular e de álgebra linear (mais concretamente, matrizes).

Em duas frases, a cifra de Hill tem como chave uma matriz num dado $\mathbb{Z}_m$ e o modo como encripta mensagens é partindo-a em bocados com o mesmo tamanho e depois multiplicando a matriz chave por esses bocados.

Num futuro próximo eu vou dar um workshop sobre o assunto e por isso decidi escrever um notebook em Python com uma breve explicação da cifra, bem como com uma implementação da mesma cifra. O notebook está disponível para ser lido e descarregado aqui. Se tiverem alguma sugestão ou comentário, estão à vontade para o deixarem na secção em baixo.

  - RGS

Popular posts from this blog

Tutorial on programming a memory card game

Markov Decision Processes 01: the basics

The hairy ball theorem and why there is no wind (somewhere) on Earth