Abstract Optical information encryption is an effective security strategy currently used to protect data and prevent information leakage. However, the optical information encryption technology based on mechanoluminescent (ML) materials faces challenges of the single encryption mode and the lack of systematic dual‐key decryption strategies. In this study, a three‐layer structure optical encoder is proposed using porous ML material as the luminescent layer, a quartz transparent tube with pressure‐sensing capabilities as the stress‐loading layer, and photodetector as the optical recognition layer. A dual‐key encryption system based on the evolution mechanism of the Ba‐Gua is constructed. The encoding process of the optical encoder is completed within a micro darkroom fabricated using 3D printing technology. This system incorporates virtual position encoding in conjunction with trigram orientation, requiring two keys for correct decryption: the “Combination Relative Optical Intensity Ratio” and the “Virtual Position Space Code”. By linking the ML emission spectrum with the trigram information, a dynamic, rewritable encryption system for hybrid encoding of digital and Chinese character based on Ba‐Gua evolution is established. The proposed optical encoder and dual‐key encryption system offer new directions for concealing confidential information and multidimensional encryption applications.