A novel planar configuration of a multiport encoder/decoder (E/D) is presented that has enhanced performance in terms of beat-noise suppression and network confidentiality. We insert a splitter and a set of phase shifters in front of a standard arrayed-waveguide-grating-based multiport E/D to generate spectral-phase codes. The new configuration keeps the same key features and it is able to generate/process a set of different codes simultaneously; at the same time, the network confidentiality is enhanced, because only the intended receiver, which knows the phase-shifter values, is able to recognize the code. Furthermore, whereas the auto-correlation function of the previous E/D has a triangular shape, in this case it is similar to the input pulse, enhancing the system cascadability and reducing the beat noise.