  Let $\mu$ be an even measure on the real line $\mathbb{R}$ such that $$c_1
\int_{\mathbb{R}}|f|^2\,dx \le \int_{\mathbb{R}}|f|^2\,d\mu \le
c_2\int_{\mathbb{R}}|f|^2\,dx$$ for all functions $f$ in the Paley-Wiener space
$\mathrm{PW}_{a}$. We prove that $\mu$ is the spectral measure for the unique
Hamiltonian $\mathcal{H}=\left(w&00&\frac{1}{w}\right)$ on $[0,a]$ generated by
a weight $w$ from the Muckenhoupt class $A_2[0,a]$. As a consequence of this
result, we construct Krein's orthogonal entire functions with respect to $\mu$
and prove that every positive, bounded, invertible Wiener-Hopf operator on
$[0,a]$ with real symbol admits triangular factorization.
