Principles of printing security based on grating phase encoding are analyzed and the corresponding design scheme and process are also provided.Several security devices for single-direction and four-direction encoding and decoding are designed and fabricated.Study results indicate that the technologies presented in this paper are based on phase encoding of gratings and Moiré principle.For multi-direction encodings,encoding frequency,encoding phase,stripe width and encoding direction are crucial parameters for designs which affect visual effects of decoding.Fabricated devices with single-direction and four-direction achieve expected requirements.This technology can be applied in printing security fields for enhancing the quality of anti-counterfeiting.