The problem was overflow in max_length when we tried to des_decrypt() something which is not the output of des_encrypt()