Results 1 to 9 of 9

Thread: Reverse Modulus?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2001
    Location
    Maumelle, AR
    Posts
    624

    Reverse Modulus?

    I take a number (3) and do the following to it:

    Num1= (3+7)%10


    This gives us 10%10. The remainded of 10/10 is 0.
    Now how can I work backward from this answer to get back to 3. I need to somehow "reverse" the modulus operation. This is for a simple Encryption/Decryption program. Any help appreciated.

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    You can't.

    For the simple reason that 13, 23, 33, 43 and so on would all give you the same answer - 0.

    (3+7)%10 = 0
    (13+7)%10 = 0
    (23+7)%10 = 0
    (33+7)%10 = 0
    (43+7)%10 = 0
    I don't live here any more.

  3. #3
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682


    So you see, there are infinitely many X values for any given Y value.
    Attached Images Attached Images  
    I don't live here any more.

  4. #4
    pathfinder NotLKH's Avatar
    Join Date
    Apr 2001
    Posts
    2,397
    Hmmm,

    If your encryption is, given Y, F(y) = (Y + (10 - Y)) Mod 10,

    Then not only do you have the ultimate secure encryption, but you must also get awesome compression ratios!
    It's Brilliant!

  5. #5
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    and impossible to decrypt afterwards!

  6. #6
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682
    No, what you actually have is a very poor hash function.

    SHA is teh h@sh pwner.

  7. #7
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    It's something I'd never thought of to use in encryption, and it is a very nice one way encryption method, but it can be bruteforced quite easily. It really is quite nice though.
    Have I helped you? Please Rate my posts.

  8. #8

  9. #9
    Fanatic Member alkatran's Avatar
    Join Date
    Apr 2002
    Location
    Canada
    Posts
    860
    Originally posted by NotLKH
    pathfinder
    We'll meet again! You just wait!
    Don't pay attention to this signature, it's contradictory.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width