A new strategy for encoding polypeptide libraries with photolabile tags is developed. The photoassisted assay, based on conditional release of encoding tags only from bound pairs, can differentiate between peptides which have minor differences in a form of post-translational modifications with epigenetic marks. The encoding strategy is fully compatible with automated peptide synthesis. The encoding pendants are compact and do not perturb potential binding interactions.