Professional Documents
Culture Documents
Modular Arithmetic
Modular Arithmetic
Modular Arithmetic
Basic idea:
• Suppose your input is the number of hours since January 1, 2010. Suppose
that number is 24,002. Now we apply the mod operator with base 24. This
gives us the remainder of 24,002/24 = 2. Suppose you see “2” which
represents 2am. You have no way of reversing the 2. It could be 2am on
any day. The only way to “reverse” is by brute force.
10