The eight-port homodyne detector is an optical circuit designed to perform the monitoring of two quadratures of an optical field, the signal. By using quantum Bose fields and quantum stochastic calculus, we give a complete quantum description of this apparatus, when used as quadrature detector in continuous time. We can treat either the travelling waves in the optical circuit, either the observables involved in the detection part: two couples of photodiodes, postprocessing of the output currents. The analysis includes imperfections, such as not perfectly balanced beam splitters, detector efficiency, electronic noise, phase and intensity noise in the laser acting as local oscillator; this last noise is modelled by using mixtures of field coherent states as statistical operator of the laser component. Due to the monitoring in continuous time, the output is a stochastic process and its full probability distribution is obtained. When the output process is sampled at discrete times, the quantum description can be reduced to discrete mode operators, but at the price of having random operators, which contain also the noise of the local oscillator. Consequently, the local oscillator noise has a very different effect on the detection results with respect to an additive noise, such as the noise in the electronic components. As an application, the problem of secure random number generation is considered, based on the local oscillator shot noise. The rate of random bits that can be generated is quantified by the min-entropy; the possibility of classical and quantum side information is taken into account by suitable conditional min-entropies. The final rate depends on which parts of the apparatus are considered to be secure and on which ones are considered to be exposed to the intervention of an intruder. In some experimentally realistic situations, the entropy losses are computed.