To further robust confidentiality protecting against eavesdropping over optical code-division multiple-access (OCDMA) networks, this study improves the robustness of the network toward eavesdropping for encryption/decryption mechanism by using a specified storage register controller controlling optical switches approach in which Free-spectral-range group hopping code is used to generate a specific signature address. This paper presents an enhanced security mechanism to protect spectral-amplitude-coding optical code-division multiple-access (SAC-OCDMA) networks against eavesdropping. This study proposes an alternative to huge code-space size techniques such as wavelength hopping and exchange-encode for network protection against eavesdropping by exploiting the cyclic properties of arrayed-waveguide-grating routers and maximal-length sequence code (M-sequence code). In addition, the network is protected using a wavelength hopping based on optical switches and exchange the encode assignment scheme implemented using the exchange switches before import to arrayed-waveguide-grating routers (AWG).In this scheme, eavesdropper is difficult to solute correct user data bit , whatever there is using brute-force searching or simple energy detector..