move DB parameters to def; separate inside and outside for decrypt page