bradencarlson / sage-jupyter

SageMath files (via Jupyter Notebooks) that give an introduction to using SageMath to explore select topics in Abstract Algebra and Cryptography. Note that no local installation of SageMath or Jupyter Notebooks is required to access and use this Project
MIT License
4 stars 3 forks source link

RSA Issues #15

Closed bradencarlson closed 2 years ago

bradencarlson commented 2 years ago

Encryption algorithm not working properly

bradencarlson commented 2 years ago

This only applies when this is being imported in the sage terminal from the python repository PiPy

bradencarlson commented 2 years ago

Actually, after further inspection, this works just fine, I just defined stuff wrong. Oops.

bradencarlson commented 2 years ago

the decryption is not working properly, I think it may have something to do with the size of the exponent.

bradencarlson commented 2 years ago

This has been fixed, the problem was in the math.floor() method call in the to_binary() method. This has been changed to instead invoke the // operator from python, which then gives the correct binary representation of the exponent, which then allows for a correct decryption.