added key encryption & some tests