The anodic cyanation of methanolic solutions of the 2-alkyl-N-phenylpiperidines 6b-d was performed in a flow cell equipped with a graphite felt anode. The reaction led to the formation of the 2-cyano-6-alkyl-N-phenylpiperidines 2b-d and proceeded with a high degree of regioselectivity. The 1H NMR spectra of the aminonitriles 2b-d showed an epimeric mixture at C-6. The major isomer has a trans configuration in which the cyano group is axial and the alkyl substituent is equatorial. Conversely, electrochemical oxidation of the 4-methyl-6-pentyl-N-phenylpiperidine 6e afforded the trisubstituted aminonitrile 2e as a single diastereomer (> 98% de). The 4-cyanobutyl side chain was incorporated in a two-step procedure to yield dinitrile 4e. This latter compound was directly converted into spiropiperidine 5e by using the Thorpe-Ziegler annulation procedure. The overall sequence (4 steps, 43%) allows the construction of the basic carbon framework of perhydrohistrionicotoxin.