fixes negative mod problem for p(en|de)crypt