add main_write_char()
main_encrypt_pipe(): update written byte progress in place