Counterfeit medicines
are a healthcare security problem, posing
not only a direct threat to patient safety and public health but also
causing heavy economic losses. Current anticounterfeiting methods
are limited due to the toxicity of the constituent materials and the
focus of secondary packaging level protections. We introduce an edible,
imperceptible, and scalable matrix code of information representation
and data storage for pharmaceutical products. This matrix code is
digestible as it is composed of silk fibroin genetically encoded with
fluorescent proteins produced by ecofriendly, sustainable silkworm
farming. Three distinct fluorescence emission colors are incorporated
into a multidimensional parameter space with a variable encoding capacity
in a format of matrix arrays. This code is smartphone-readable to
extract a digitized security key augmented by a deep neural network
for overcoming fabrication imperfections and a cryptographic hash
function for enhanced security. The biocompatibility, photostability,
thermal stability, long-term reliability, and low bit error ratio
of the code support the immediate feasibility for dosage-level anticounterfeit
measures and authentication features. The edible code affixed to each
medicine can serve as serialization, track and trace, and authentication
at the dosage level, empowering every patient to play a role in combating
illicit pharmaceuticals.