Context. Very-high-energy γ-rays produce electron positron pairs in interactions with low-energy photons of extragalactic background light during propagation through the intergalactic medium. The electron-positron pairs generate secondary γ-rays detectable by γ-ray telescopes. This secondary emission can be used to detect intergalactic magnetic fields (IGMF) in the voids of large-scale structure. Aims. A new γ-ray observatory, namely, Cherenkov Telescope Array (CTA), will provide an increase in sensitivity for detections of these secondary γ-ray emission and enable the measurement of its properties for sources at cosmological distances. The interpretation of the CTA data, including the detection of IGMF and study of its properties and origins, will require precision modeling of the primary and secondary γ-ray fluxes. Methods. We asses the precision of the modeling of the secondary γ-ray emission using model calculations with publicly available Monte-Carlo codes CRPropa and ELMAG and compare their predictions with theoretical expectations and with model calculations of a newly developed CRbeam code.Results. We find that model predictions of different codes differ by up to 50% for low-redshift sources, with discrepancies increasing up to order-of-magnitude level with the increasing source redshifts. We identify the origin of these discrepancies and demonstrate that after eliminating the inaccuracies found, the discrepancies between the three codes are reduced to 10% when modeling nearby sources with z ∼ 0.1. We argue that the new CRbeam code provides reliable predictions for the spectral, timing, and imaging properties of the secondary γ-ray signal for both nearby and distant sources with z ∼ 1. Thus, it can be used to study gamma-ray sources and IGMF with a level of precision that is appropriate for the prospective CTA study of the effects of γ-ray propagation through the intergalactic medium. 18 Absorption of the VHE γ-rays on EBL results in produc-19 tion of electron-positron pairs in the intergalactic medium. These 20 pairs lose energy via inverse Compton scattering of the cos-21 mic microwave background (CMB) photons, thereby producing 22 secondary γ-ray emission that is detectable by γ-ray telescopes 23 (Aharonian et al. 1994). The observational visibility of this sec-24 ondary emission depends on the strength and correlation length 25 of magnetic field in the intergalactic medium and on the energy 26 range of the secondary γ-rays. Very strong intergalactic mag-27