Security in resource constrained devices