Data masking can be implemented through various techniques such as substitution, shuffling, and encryption. For instance, in substitution, real data is replaced with fictitious data of the same type. In the context of cancer, this might involve replacing a patient's actual diagnosis date with a randomly generated one.