We present a 2-D barcode technique that can be used to authenticate documents. The proposed system holds much more information than one-dimensional barcode. It is robust against different types of noises and distortions. We use double phase encoding to encode information into the 2-D binary barcode. As a result, the technique is secure against unauthorized detection. We present analysis for the system performance using the statistical properties of double-phase encoding. The algorithm is tested under several types of noise and distortions, for example, additive noise, geometric distortion, fading, scratches, and occlusion. We compare the performance of amplitude-based double phase encoding and fully phase double phase encoding with that of an ordinary 2-D barcode with error-correcting code. Computer simulations and optical experiments are presented to test the robustness of the proposed method.