one way is to engineer in obscure but reproducible behaviour, along the lines of A->B->C results in D.
people who are likely to steal code are unlikely to audit it sufficiently to identify esoteric behaviour.
people who are likely to steal code are unlikely to audit it sufficiently to identify esoteric behaviour.
That gets awfully close to DRM, though.
DRM is bad because it both doesn't stop pirates and hurts normal users. This allows detection of pirates and hurts no one.