Skip to main content

The Hill cipher Encryption algorithm is one of the symmetric key algorithms that have several advantages in data encryption.

Project description

Cipher-Python-Package

Summary of the Python Package

This package encrypts your text using Hill Cipher Technique. Hill ciphers are an application of linear algebra to cryptology (the science of making and breaking codes and ciphers).

Algorithm:

Let the order of the encryption key be N (as it is a square matrix). Your text is divided into batches of length N and converted to numerical vectors by a simple mapping starting with A=0 and so on.

The key is then multiplied with the newly created batch vector to obtain the encoded vector. After each multiplication modular 36 calculations are performed on the vectors so as to bring the numbers between 0 and 36 and then mapped with their corresponding alphanumerics.

While decrypting, the decrypting key is found which is the inverse of the encrypting key modular 36. The same process is repeated for decrypting to get the original message back.

Implementation:

from pycipher import HillCipher
obj = HillCipher("beaf")
print(hc.encrypt("Love Python"))
print(hc.decrypt("PITTOO"))

References:

https://apprendre-en-ligne.net/crypto/hill/Hillciph.pdf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyciphers-1.0.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

pyciphers-1.0.0-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page