The cyanide is [tex]CN^{-}[/tex]
A carbon atom has 4 valance electrons and nitrogen has 5. Below is a Lewis-dot-structure of cyanide.
:N≡C.
The carbon atom is still one electron short of having a full octet and so it will seize another electron from almost anything, making the cyanide ion negative and whatever it took the electron from it now positive.