Modularized encryption function, to it's own function...no longer contained in main.