Actually make encryption work.
Remove some diagnostic output and commented-out code.