I'm working on encryption, and for the private key metric dyou need to multiply d by e and take the mod of a different number, and the remainder is 1. I already have a function:
private void genD() {
d = e / 2;
while ((d * e) % eN != 1) {
d++;
}
}
what I have now is obviously a rude way of doing things, going through each number until it works. I know that the equation does its job by connecting the numbers using the working example found here , but VERY VERY VERY slow using the for numbers I create. Logically, I feel that there is a way to do this much faster, but I can’t think about how?
Any help is appreciated! Thanks in advance:)