Energy-rate based MAC protocol for wireless sensor networks and key pre-distribution schemes