Modular mathematics

  • #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...
 

Answers and Replies

  • #2
4
0
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
35,135
11,373
data might be limited to a range like [0,199], that would allow decrypting it (simply by taking encrpytedvalue-3 mod 200).
 
  • #4
Yes, my data has a range from 1 to 200...
 
  • #5
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?
 
  • #7
That is the same mod 200.Of course it is possible.
Yes...got it. Thanks...
 

Related Threads on Modular mathematics

  • Last Post
Replies
4
Views
1K
  • Last Post
Replies
7
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
5
Views
572
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
8
Views
5K
  • Last Post
Replies
5
Views
2K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
1
Views
1K
Top