Newton used anagrams which are not the usual ciphers. It is not designed for a secret communication, but only for proving at a later time that you knew something. So nobody is supposed to be able to decode the message until you tell what the message was.
To do this, he used a simple procedure: he wrote a sentence (in Latin) and then just
counted letters in it. And the anagram consisted of the list of letters and how many times
each letter occurs in the message.
An example of such anagram is given on Math Overflow:
https://mathoverflow.net/questions/140327/arnold-on-newtons-anagram
together with its decoding, according to Newton's later statements.
The message was usually sent to some third party (Oldenburg, the secretary of the Royal Society in
the case of Newton), who then forwarded a copy to the addressee (Leibniz).
The discoveries Newton wanted to secure this way was essentially "calculus",
more precisely power series.
There were two coded messages in two different letters to Leibniz via Oldenburg.
You can see the exact messages in the MO (link above).
Similar methods were widely used to secure priority in 17-th and 18-th centuries.
The last time that I know was in 1918
when Gaston Julia send sealed (not coded) messages to the Academie de Science, and these messages had to be publicly opened and read at some later time on his request, to prove his priority. At that time this practice was already obsolete, and Julia was criticized for using it. However he was able to prove his priority and a Grand Prix of the Academy was awarded to him (for what is known now as "Holomorphic dynamics").
http://www.springer.com/mathematics/history+of+mathematics/book/978-3-642-17853-5