Ensuring privacy and security in smart medical devices