With the ever increasing bandwidth of optical communications systems, it is critical to allow multiple users to access the available bandwidth. Code division multiplexed access (CDMA) is especially attractive in local area networks due to the large number of subscribers possible, the security and the simple architecture. Here we presents novel encoding/decoding structures using anti-symmetric gratings with application in optical CDMA and optical encryption.