As a school project, I have to make a program that can encrypt and decrypt code, whilst also registering the encoded code in a database.
But I’ve encountered a problem:
To encrypt a message using RSA, you need to lift the message to a power and then take the modulo. That’s all fun and games, until I start using double digit numbers. The result of the exponent quickly reaches the long max value, 9,223,372,036,854,775,807.
This is a major problem, since taking the modulo of 9,223,372,036,854,775,807 will always result in the same result, making every bit of message the same.
Does anybody have a way to work around this? The math program Maple is able to do the calculations perfectly, but it’s quite a bother to be switching between the two programs in an assignment.
Thanks in advance