Some implementations provide a computer-assisted method for embedding information in an identification document. The method includes: modulating information by varying lengths of line segments; generating a line code that includes the line segments with corresponding lengths; and applying the line code on an identification document such that the information is used to authenticate the identification document as genuine when a person presents the identification document to verify an identify of the person.