Ahmad ibn ‘Ali al-Buni (Arabic: أحمد البوني), his complete name is Sharaf al-Din or Shihab al-Din Ahmad ibn Ali ibn Yusuf al-Buni al-Maliki al-ifriqi (born in Annaba, Algeria died 1225) was a well known Sufi and writer on the esoteric value of letters and topics relating to mathematics, sihr (sorcery) and spirituality, but very little is known about him. Al-Buni lived in Egypt and learned from many eminent Sufi masters of his time.
A contemporary of Ibn Arabi, he is best known for writing one of the most important books of his era; the Shams al-Ma'arif, a book that is still regarded as the foremost occult text on talismans and divination. It was to be banned soon after as heretical by followers of the Islamic orthodoxy.
Instead of sihr (Sorcery), this kind of magic was called Ilm al-Hikmah (Knowledge of the Wisdom), Ilm al-simiyah (Study of the Divine Names) and Ruhaniyat (Spirituality). Most of the so-called mujarrabât ("time-tested methods") books on sorcery in the Muslim world are simplified excerpts from the Shams al-ma`ârif. The book remains the seminal work on Theurgy and esoteric arts to this day.
In c. 1200, Ahmad al-Buni showed how to construct magic squares using a simple bordering technique, but he may not have discovered the method himself. Al-Buni wrote about Latin squares and constructed, for example, 4 x 4 Latin squares using letters from one of the 99 names of Allah. His works on traditional healing remains a point of reference among Yoruba Muslim healers in Nigeria and other areas of the Muslim world.