# I Modular mathematics

1. Mar 27, 2017

### Fiona Rozario

I have some data which I am encrypting using modulus - (data + 203) mod 200. If the data is 150, I get the result as 153. Is there a way to decrypt and get my data (150) back? I don't know how to calculate inverse of this operation...

2. Mar 27, 2017

### Oedipus

Your encrypting operation is the function ƒ(x)=(x+3) mod 200. For a function ƒ: X→Y to be invertible, for every y∈Y there must be one and only one x∈X so that ƒ(x)=y. In your case, the result 153 can be obtained from multiple data values: 150, 350, 550 and so on. There are multiple x∈X that satisfy ƒ(x)=153, so your operation is not an invertible function. In other words, your decryptor cannot possibly know whether the data was 150,350,550...etc. when it receives the encrypted data 153.

3. Mar 27, 2017

### Staff: Mentor

data might be limited to a range like [0,199], that would allow decrypting it (simply by taking encrpytedvalue-3 mod 200).

4. Mar 27, 2017

### Fiona Rozario

Yes, my data has a range from 1 to 200...

5. Mar 27, 2017

### Fiona Rozario

Thanks for the help...i am adding 203 to the data (not 3). I tried doing what mfb suggested. But (153-203) is not possible and (203-153) gives 50. 50 mod 200 doesn't give 150...am I going wrong somewhere?

6. Mar 27, 2017

### Staff: Mentor

That is the same mod 200.
Of course it is possible.

7. Mar 27, 2017

### Fiona Rozario

Yes...got it. Thanks...