1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I Modular mathematics

  1. Mar 27, 2017 #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...
     
  2. jcsd
  3. Mar 27, 2017 #2
    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.
     
  4. Mar 27, 2017 #3

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    data might be limited to a range like [0,199], that would allow decrypting it (simply by taking encrpytedvalue-3 mod 200).
     
  5. Mar 27, 2017 #4
    Yes, my data has a range from 1 to 200...
     
  6. Mar 27, 2017 #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. Mar 27, 2017 #6

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    That is the same mod 200.
    Of course it is possible.
     
  8. Mar 27, 2017 #7
    Yes...got it. Thanks...
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Modular mathematics
  1. Modular Multiplication (Replies: 0)

  2. Modular Inverses? (Replies: 8)

  3. Modular arithmetic (Replies: 5)

  4. Modular Mathematics (Replies: 4)

  5. Modular arithmetic (Replies: 7)

Loading...