The social media giant said it worked with cryptographers to devise ways of excluding unwanted guests.