Fix two bugs: wrong key distributed at login + change protection key

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>