Connection to database + encryption