Mobile security and privacy : attacks and defenses