Surely we can come up with a better technical solution for this!
Currently pharmaceutical companies try to prove authenticity by e.g. printing little holograms on the pillboxes, which is not very effective since pirates can print holograms too. How about this instead:
Each pillbox comes with a little paper which contains a random-looking string of characters and a trademark. It is folded-over and sealed so the contents are not readable. When an end-consumer wants to know if their drug is authentic or not, they tear open the paper, go to a website operated by (say) the US Patent and Trademark Office, and type in the trademark and character string (or scan a QR code). The website says "authentic"/"inauthentic"/"this string was already used".
On the production side, you can set it up so that the factory needs to communicate with a central company server to allocate codes, so you get an accurate count of how many codes are produced and if it matches the amount of drugs manufactured. This way, if an insider starts leaking codes to pirates it can be noticed quickly.