standardize decrypt and depad functions