How would I reverse this?
<p>Ok, I'm having troubles, this is supposed to generate encrypted text (in numbers).</p>

<p>However, after I encrypt it (if it worked the way i planned, can't tell yet), I can't seem to revert it back to normal?</p>

<p>The reversion process starts at //testing purposes
But it isn't giving me the original value?</p>

<p>I mean, orig[] SHOULD be giving me what userluv[] has</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstring&gt;
#include &lt;cstdio&gt;

using namespace std;

int main()
{
    char userluv[800], orig[800], key [51], priv [21];
    int tempfussd[800], kint, pint, tint[5], c;

    //get the basic info
    cout &lt;&lt; "key? ";
    gets(key);
    cout &lt;&lt; "Second key? ";
    gets(priv);
    cout &lt;&lt; "Your lovely text?:";
    cin.get();
    gets(userluv);

    for(c=0; c&lt;=key[c]; c++){
        kint += key[c];
    }
    for(c=0; c&lt;=priv[c]; c++){
        pint += priv[c];
    }


    //do shit to your key
    tint[0] = strlen(key) + strlen(priv);
    tint[1] = tint[0] * tint[0];


    //string to int then do shit :S
    for(c=0; c&lt;=userluv[c]; c++){
        tempfussd[c] = userluv[c];
        tempfussd[c] += kint;
        tempfussd[c] *= pint;
        tempfussd[c] *= tint[1];
        cout &lt;&lt; tempfussd[c];
    }

        cout &lt;&lt; "\n";

    //testing purposes
    for(c=0; c&lt;=userluv[c]; c++){
        orig[c] = tempfussd[c];
        orig[c] %= tint[1];
        orig[c] %= pint;
        orig[c] -= kint;
        cout &lt;&lt; orig[c];
    }

    return 0;
}
</code></pre>
