Posts

Showing posts with the label matrices

Introduction to the Hill Cipher

Image
Pt En 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...