We investigate the effects of photon-number quantum-nondemolition measurements performed by an eavesdropper on a two-photon correlated state. The relation between this model and quantum cryptography is discussed. It is shown that violation of Bell's inequality is very sensitive to the probe amplitude of the measurement system.