Secure and resilient federated learning