The Abelian representation of the string Becchi–Rouet–Stora (BRS) cohomology in terms of basic operators naturally forming two dual Kugo–Ojima quartets is found. Furthermore, using a gauge-fixing scheme, a contracting homotopy operator associated with the string BRS operator is constructed. This formalism gives the explicit realizations of the physical and unphysical subspaces. The passage between Abelian and non-Abelian quantities is realized geometrically through the use of the moments of the vertex operator, which act as vielbeins between infinite-dimensional algebras. The connection between the Virasoro and spectrum-generating algebras is clarified and the algebraic duality relation between them is uncovered.