A Low-Energy Security Solution for IoT-Based Smart Farms