  Ultra-high energy (UHE) photons play an important role as an independent
probe of the photo-pion production mechanism by UHE cosmic rays. Their
observation, or non-observation, may constrain astrophysical scenarios for the
origin of UHECRs and help to understand the nature of the flux suppression
observed by several experiments at energies above $10^{19.5}$ eV. Whereas the
interaction length of UHE photons above $10^{17}$ eV ranges from a few hundred
kpc up to tenths of Mpc, photons can interact with the extragalactic background
radiation initiating the development of electromagnetic cascades which affect
the fluxes of photons observed at Earth. The interpretation of the current
experimental results rely on the simulations of the UHE photon propagation. In
this paper, we present the novel Monte Carlo code EleCa to simulate the
$Ele$ctromagnetic $Ca$scading initiated by high-energy photons and electrons.
  We provide an estimation of the surviving probability for photons inducing
electromagnetic cascades as a function of their distance from the observer and
we calculate the distances within which we expect to observe UHE photons with
energy between $10^{17}$ and $10^{19}$ eV. Furthermore, the flux of GZK photons
at Earth is investigated in several astrophysical scenarios where we vary both
injection spectrum and composition at the source and the intensity of the
intervening extragalactic magnetic field. Although the photon propagation
depends on several astrophysical factors, our numerical predictions combined
with future experimental observations (or non-observations) of UHE photons --
in the energy range between $10^{17.5}$ eV and $10^{20}$ eV -- can help to
constrain these scenarios.
