They're generated based on the BCM's internal certificate (from the factory) and paired with the DU at install. So, unique to the car, but nothing to do with the VIN per se.
I spent years developing hardware and software that allow the use of the Tesla drive units without any physical modifications to the drive unit. Also developed this process to work with any variation of Model S/X drive unit from day 1 to present, including the front versions.
The controller replacement setups are pretty terrible. I've tried every one of the ones I'm aware of on my test bench... I mean heck, one of them uses a hobbyist WiFi module for primary control... like seriously.
Anyway, getting full control over the units and refining that to the point where they can be used outside of a Tesla vehicle without hardware modifications has taken years to get perfect. Best of luck if that's the route you're going. Some hurdles are easier than others, but there's some doozies in there.