We propose and demonstrate the enhancement of data networks security using optical signal processing. Optical steganography that based on spread spectrum is used to inhibit the observation and analysis of data traffic. With the use of opticalCDMA, service interruption is prevented in the presence of infrastructure attacks. Unlike conventional wavelength and time multiplexing approaches, the soft blocking capability provides protection paths without the need of permanently reserving the bandwidth. Optical CDMA also provides a large code set and the large cardinality reduces the probability of interception of the secure signal by an eavesdropper. To prevent side-channel attacks, all-optical encryption is demonstrated that provides real-time encryption.