I've hunted and trapped wild hogs for all of my 72 years. I've also heard all the stories of wild hog attacks, but I have never witnessed, or been a victim of one. Not that they don't happen, but not very frequently and then mostly because of bad judgment.
A domestic sow with little ones might try to eat you up if she perceives that you are a danger to them. But then domestic pigs are not afraid of humans, they see them everyday. A wild sow and her brood will take off at the first sign of trouble, shoats scattering everywhere. A domestic boar might try to get you in his pen, but a wild one will head for the hills a soon as he spots you. There are some exceptions however.
Caught in a trap, or cornered, all hogs large and small, male and female will attack. Some wounded hogs will attack also, but most just want to get away. In the frenzy created when dogs catch a hog anything can happen. The hog might run over you in an attempt to get away, you may get bit by the hog or even a dog. Bedlam rules in this situation.
Generally speaking wild hogs don't present much of a problem when encountered in the woods, day or night. While it might be a thrill of sorts to find yourself in the middle of a bunch grunters, you aren't in much danger. A good loud spoken "GIT" and they'll take off.
As for trapping hogs out of an area, you can't. The wild hogs we have around here were brought in by Spanish explorers in the 15th century. They have been shot, trapped, caught by dogs, hit by trucks, you name it, for 500 years and we still have plenty of them.