Protection for Resource-Constrained Devices -- Multipurpose Cryptographic Primitive