I Decrypting Data with Modular Mathematics

  • I
  • Thread starter Thread starter Fiona Rozario
  • Start date Start date
  • Tags Tags
    Mathematics
Fiona Rozario
Messages
52
Reaction score
1
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...
 
Mathematics news on Phys.org
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.
 
data might be limited to a range like [0,199], that would allow decrypting it (simply by taking encrpytedvalue-3 mod 200).
 
Yes, my data has a range from 1 to 200...
 
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?
 
Fiona Rozario said:
i am adding 203 to the data (not 3)
That is the same mod 200.
Fiona Rozario said:
But (153-203) is not possible
Of course it is possible.
 
mfb said:
That is the same mod 200.Of course it is possible.

Yes...got it. Thanks...
 
Back
Top