I don't see the harm of creating such a device for self-defence! As long as you're prepared to test it on yourself first.....
4KV would be next to useless, you would need in the region of 30KV for an effective machine. I'd use an oscillator & a tripler cct to the desired voltage. If you have an old TV lying around, you can get some handy HV parts from it!