Thread: inversion

  1. #1
    Registered User
    Join Date
    Oct 2002

    Arrow inversion

    Ok, i have an encryption algorithm, and am working on the decryption algorithm. I need to reverse some stuff, and I'm having trouble trying to invert this line:

    b = i % strlen(in) - 1;

    How can I invert b so that say b = 0, i change it so b = strlen(in) - 1, or if b = 1, change it to b = strlen(in) - 2

    Any help would be great, thanks

  2. #2
    Registered User
    Join Date
    Sep 2002
    I don't know an exact answer to your question but I know the modulus function is hard to reverse. Have a look at RSA encryption scheme, that reverses a mod and you might get some ideas from that. Your problem seems more like maths than programming, figure out how to do it on paper before trying to code it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. priority inversion due to pthread_mutex_lock(): how to avoid?
    By mynickmynick in forum C Programming
    Replies: 11
    Last Post: 04-07-2009, 10:34 AM
  2. Matrix inversion
    By magda3227 in forum C Programming
    Replies: 2
    Last Post: 06-23-2008, 07:28 PM
  3. Gauss-Jordan Matrix Inversion in C++
    By Max_Power82 in forum C++ Programming
    Replies: 3
    Last Post: 12-03-2006, 08:31 PM
  4. generalized matrix inversion program
    By ashesh in forum C Programming
    Replies: 1
    Last Post: 08-13-2002, 11:41 PM
  5. string inversion
    By Kohatian 3279 in forum C++ Programming
    Replies: 13
    Last Post: 05-01-2002, 03:45 PM