rewrote cipher module