  We study barred galaxies selected from the Illustris cosmological simulation,
focusing on tidally induced bars formed from flyby interactions. To guarantee
high enough resolution we focus on high mass disc galaxies ($M_*>8.3 \times
10^{10} M_{\odot}$). We find that the fraction of barred galaxies among those
(21% at redshift $z=0$) is lower in Illustris than observed in the local
Universe, and the fraction grows slightly with redshift. The bar fraction also
increases with the stellar mass and decreases with the amount of gas in the
disc. Only very few bars at redshift $z=0$ are formed in secular evolution
($\sim$ 7%) and most of them are triggered by external perturbers in mergers or
flybys. Many of these bars disappear over time, mostly during secular
evolution, which leads to a lower fraction of bars at redshift $z=0$. We then
focus on the effect of flyby interactions on the disc and look at tidally
induced bars created by a flyby, or pre-existing bars influenced by the passage
of a perturber. In the latter case, the interaction can enhance or weaken the
bar. During the interaction, the change in the bar strength occurs right after
the pericentre passage. The resulting tidally induced bars tend to be stronger
than the overall bar sample in Illustris. The preferred scenario to create or
enhance a bar seems to be with a strong interaction involving a perturber on a
prograde orbit. Furthermore, the strength of the created bar grows with the
strength of the interaction.
