![way of the samurai 4 shinobi duel arms hara way of the samurai 4 shinobi duel arms hara](https://i.pinimg.com/236x/ae/bf/1c/aebf1c4fd5c5c813665af320ddddbff1.jpg)
As a consequence, their perception in popular culture is based more on such legend and folklore than on the spies of the Sengoku period. Ninjas figured prominently in legend and folklore, where they were associated with legendary abilities such as invisibility, walking on water and control over the natural elements. A number of shinobi manuals, often based on Chinese military philosophy, were written in the 17th and 18th centuries, most notably the Bansenshukai (1676).By the time of the Meiji Restoration (1868), shinobi had become a topic of popular imagination and mystery in Japan. Following the unification of Japan under the Tokugawa shogunate in the 17th century, the ninja faded into obscurity. Though shinobi proper, as specially trained spies and mercenaries, appeared in the 15th century during the Sengoku period (15th–17th centuries), antecedents may have existed as early as the 12th century.In the unrest of the Sengoku period, mercenaries and spies for hire became active in Iga Province and the adjacent area around the village of Kōga, and it is from the area's clans that much of the knowledge of the ninja is drawn. Their covert methods of waging irregular warfare were deemed dishonorable and beneath the honor of the samurai. The functions of a ninja included espionage, deception, and surprise attacks. A ninja (忍者) (hiragana: にんじゃ) or shinobi (忍び) (hiragana: しのび) was a covert agent or mercenary in feudal Japan.