This is what has been annoying me just a bit and would appreciate any help. I have to write this program that encrypts and decrypts 4 character numbers.

For example..

Encrypt 3246 by adding 7 to each digit and modulus that total by 10.

(x+7) % 10

(3+7) % 10 = 0

(2+7) % 10 = 9

(4+7) % 10 = 1

(6+7) % 10 = 3

Now that was the easy part now I have to decrypt 0913 so I get the value 3246.

I tried to find the opposite calculation of modulus but to no avail. I would appreciate any help.