We propose a general scheme to generate entanglement encoded in the photon-number basis, via a sequential resonant two-photon excitation of a three-level system. We apply it to the specific case of a quantum dot three-level system, which can emit a photon pair through a biexciton–exciton cascade. The state generated in our scheme constitutes a tool for secure communication, as the multipartite correlations present in the produced state may provide an enhanced rate of secret communication with respect to a perfect GHZ state.