In Heart of Darkness, what does cipher mean?

As a noun, cipher is another word for code or a message written in code. (When you convert a code into something readable, you decipher it.) As a verb, it means to do arithmetic.

In Heart of Darkness, Marlow goes deeper and deeper into the jungle. As the jungle grows more frightening and mysterious, he struggles to keep himself calm and "European." He eventually comes across an old hut and, in it, a book. His joy in finding the book reflects his longing for a sign of his previous world as he trudges through this new one. Marlow is excited by its very existence as "something unmistakably real." When he's summoned to return to the steamboat, Marlow confesses that putting down the book is like "tearing myself away from the shelter of an old and solid friendship." The "friendship" Marlow refers to is his long one with Europe, which has always kept him "sheltered" from the truth of his kinship with "savagery."

In the margins of the book, Marlow finds what he thinks is code, or cipher. (He eventually discovers that the notes are actually in Russian.)

Such a book being there was wonderful enough; but still more astounding were the notes pencilled in the margin, and plainly referring to the text. I couldn't believe my eyes! They were in cipher! Yes, it looked like cipher. Fancy a man lugging with him a book of that description into this nowhere and studying it — and making notes — in cipher at that! It was an extravagant mystery.