It sounds like you have a bad factoring algorithm. Did I say it was the best? The point IS is that both are written identical...simply using modulus of 0 in both.
As for your "pretty cool encryption system", why should I trust an unverified encryption system written by a novice programmer? (Before you get offended by that characterization, learn how to write a link that will work in a browser other than IE.) LOL - For the same reason that I shouldn't value the opinion of a nitz that spells algorhythm 'algorithm'. : )