I’ve seen this solved. But the solution is ugly (in the sense that I wouldn’t recommend it for a standard install).
The trick: encryption key in a shared memory location, supplied at boot time by a human.
This was the recommended way to use a credit card number storage tool I worked with a few years ago.