In a book called Maha-prajna-paramitopadesa, the great Indian philosopher Nagarjuna (second century) says about dharanis, “If a Bodhisattva obtains the power of dharanis, he will never lose the Dharma from his memory, but will keep it forever.”
This idea was later developed to mean that if someone continues in this practice diligently until he can recite an entire sutra by heart, he will obtain the miraculous power inherent in that sutra. Phrases and words of the sutra are then called dharani-spells. In the Lotus Sutra, the dharani-spells are uttered to protect the practitioners, teachers, and expounders of the Sutra.
Introduction to the Lotus Sutra