If staying overnight I will keep a fixed-blade survival knife, bear spray, and a .45 ACP within reach of my bedroll. If I'm just out for a day hike I only take a pocket knife. As you can tell, I'm not fond of the idea of someone rolling up on me foggy-eyed in the middle of the night with camp fully set and no where to fall back to.
With that said, I've never had a problem with critter or human in my adventures, knock on wood. Some of my luck may have to do with a bit of a spidey sense I have about folks with ill intent, though. I know what trouble looks like because I saw a lot of trouble in my mispent youth. I would advise following your instincts if you run into someone who seems shady on the trail and give the friendly impression that you are not to be trifled with as you move on your way.
Stay safe, be well, and know peace.