fixed function bloat in 2 functions for enc and dec files