CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

More efficient modular inverse

Open profbbrown opened this issue 8 months ago • 0 comments

Replaces the existing brute-force modular inverse function with a more efficient one that uses the Extended Euclidean Algorithm.

https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm

Retains backward compatibility by returning undefined if the modular inverse cannot be found, although a better return value would probably be null.

profbbrown avatar Jun 13 '24 21:06 profbbrown