Every cell in your body already does this, you just might not have noticed. You didn't notice because you didn't grow an extra limb or eyeball, which might happen if it wasn't for this.
You ask for encryption. Now one thing you can do with DNA is encypher it, which is kind of what Mołot's answer went towards. This is not as much encryption as merely obscuring the data. Everything you need to decode the data is present, it just might be difficult.
If you want encryption, then what you want is a "key" such that anyone who knows this "key" can decode the data properly. Someone who doesn't have this "key" cannot.
So I say every cell in our body does this, because they are differentiate. Every skin cell has "forgotten" how to become a liver cell. Every nerve cell has "forgotten" how to be a pancreas. If any one of them knew the magic key that would bring them back to being a "stem cell," then they could change their role in the body. But without that key, they remain differentiated.
Now this may just be enciphering. We've made great strides in building keys that teach cells how to become stem cells. So it looks like the keys may have been there all along, but it's also possible that it just plain doesn't work that way and that the keys are permanently lost.
There are some solid examples of permanently lost capabilities. Red blood cells shed their nucleus before moving out into the blood stream, so they truly lack the knowledge to be able to reproduce.
So to truly encrypt the data, you need something that functions as a "key" which you can introduce during construction and remove afterwards. What you probably want is a protein structure which can do the decoding on RNA strands before they are used to assemble the proteins. In your "pure" strand which knows the key, this protein structure is encoded into the DNA, and gets built as the creature grows.
At some point you introduce a virus with a "kill" signal. This signal triggers a mechanism in that structure which has a CRISPR like effect which excises the DNA "key" which can produce that structure.
Proteins don't last forever. So after a short while, every copy of this decoder protein is gone, and because the code to generate them has been excised, no new proteins will be created. Now your creature no longer has access to those encrypted DNA strands.
You'd probably keep a breeding stock that has never been exposed to the virus, so they keep producing new children with this capability. However, I recommend keeping the sequence in some safe somewhere, so that if a virus happens to hit your breeding stock, you haven't lost your keys.