0
Matrix in cryptography
This code is able to encrypt a plaintext but gives a different plaintext after decryption. Help me identify the errors in the code. https://code.sololearn.com/c0DsXQrAiXAw/?ref=app
3 ответов
+ 1
Here is my result after reading about affine cipher.
I used a custom alphabet list to extend the characters to include upper and lowercase letters, punctuations and numbers.
You can possibly use the entire ascii codelist, but that would probably be overkill..
There are certain constraints for the keys a and b in affine cipher. That's the important part.
The formula for getting the multiplicative inverse I got from Stackoverflow.
The keys are randomly determined every time. You can choose a certain pair and use that instead for repeatable cipher code values...
As for turning it to a numpy matrix, maybe you could explain how it's supposed to work? I'm not sure I can follow your code..
https://code.sololearn.com/chXd66e5OwdJ/?ref=app
+ 1
Believe Gagbe
perhaps you're doing something like this? It uses numpy, but it is using it differently.
https://justcryptography.com/hill-cipher/
+ 1
Great, i will take a close look a your answers.