CyberChef icon indicating copy to clipboard operation
CyberChef copied to clipboard

Operation request: modulo

Open thomasnemer opened this issue 1 year ago • 5 comments

Summary

I was facing a very simple case where I needed to take a short string as input, compute the md5 hash, then turn it into base 10, and finally get the modulo 4. (In my case, would have worked the same with the remainder).

e.g. some-string => 7e99c70638e08303f2de53eee744a371 => 168281185580737909017484253013892965233 => 1

From here, I can't find the last step.

CyberChef is capable of doing modulo, but it doesn't seem to expose it as an operation.

This seems to be a simple enough use case so I'm willing to contribute a PR.

Example Input

16

Example Output

(using mod 3 operation):

1

thomasnemer avatar Sep 06 '25 07:09 thomasnemer

Why was this closed without merging? Mod is still missing from CyberChef as of today...

ASIAubrie avatar Apr 07 '26 16:04 ASIAubrie

Why was this closed without merging? Mod is still missing from CyberChef as of today...

True, the PR stayed without review or approval for several months, so I closed it to cleanup my feed, but I would be happy to re-open it.

thomasnemer avatar Apr 08 '26 19:04 thomasnemer

I feel that having the ability to do basic mathematic operations on various inputs is valuable. We already have "sum", "subtract", "multiply", and "divide" (plus mean and median, and others) - adding modulus and exponent operations makes sense, especially when there are a number of computations/algorithms that rely on modulus operations (the Luhn algorithm and the TOTP algorithm (RFC 6238) come to mind, as examples).

If we can't get a contributor to reopen this one, I can always submit a new one as well.

ASIAubrie avatar May 08 '26 17:05 ASIAubrie

I reopened the PR.

thomasnemer avatar May 16 '26 19:05 thomasnemer

Fixed by merge of #2103

GCHQDeveloper581 avatar Jul 23 '26 07:07 GCHQDeveloper581