Isḥāq al-Kindī (801-873 CE) wrote the earliest known book on cryptanalysis, including details of frequency analysis (using aspects of probability some.
Unknown author<span style="display: none;">Unknown author</span>
circa 900 CE
Photograph of medieval Islamic manuscript, transferred from English Wikipedia as below