Optical fibers have found important applications in chemical imaging and single-particle detection. The applications make use of the propagating evanescent energy existing outside the core of a fiber. In this paper, a variational method is described to solve two-dimensional Helmholtz eigenvalue problems for a core of arbitrary shape. The method enables the problem in the infinite domain to be reduced to a bounded one by using a transparent boundary condition. It is shown that the variational formulation does not produce spurious solutions. An optimal error estimate is obtained for the associated finite element method. Finally, numerical experiments indicate that square fibers yield sufficient evanescent energy for imaging application.