Due to the vulnerability of fibers in optical networks, physical-layer attacks targeting photon splitting, such as eavesdropping, can potentially lead to large information and revenue loss. To enhance the existing security approaches of optical networks, a new promising technology, quantum key distribution (QKD), can securely encrypt services in optical networks, which has been a hotspot of research in recent years for its characteristic that can let clients know whether information transmission has been eavesdropped or not. In this paper, we apply QKD to provide secret keys for optical networks and then introduce the architecture of QKD based optical network. As for the secret keys generated by QKD in optical networks, we propose a re-transmission mechanism by analyzing the security risks in QKD-based optical networks. Numerical results indicate that the proposed re-transmission mechanism can provide strong protection degree with enhanced attack protection. Finally, we illustrated some future challenges in QKD-based optical networks.