fix null input type-error in encrypt module