My suggestion is to carry a whistle. There are small whistles hikers use if they get lost, and even more powerful whistles for marine use in fog. These are easy and inexpensive to buy, and light to carry. Use of the whistle would probably get a potential attacker to involuntarily cover his ears, startle him and maybe get him to go away. I carry one hiking all the time.