  BRST quantization is an elegant and powerful method to quantize theories with
local symmetries. In this article we study the Hamiltonian BRST quantization of
cosmological perturbations in a universe dominated by a scalar field, along
with the closely related quantization method of Dirac. We describe how both
formalisms apply to the perturbations in a time-dependent background, and how
expectation values of gauge-invariant operators can be calculated in the in-in
formalism. Our analysis focuses mostly on the free theory. By appropriate
canonical transformations we simplify and diagonalize the free Hamiltonian.
BRST quantization in derivative gauges allows us to dramatically simplify the
structure of the propagators, whereas quantization in synchronous gauge, which
amounts to Dirac quantization, dispenses with the need to introduce ghosts and
preserves the locality of the gauge-fixed action.
