Reversible or lossless data hiding enables host media to be restored from marked media without any loss of host information. However, since most of existing lossless data hiding methods are fragile, hidden data cannot be extracted after marked media goes through alteration such as JPEG compression. In this paper, we present a robust (referred to as semifragile) lossless data hiding method that utilizes sub-sampling and block gravity center. Gravity center of sub-sampled part of each block is insensitive to alteration, so it achieves robustness. This technique can be applied to selective authentication for images. That is, if a marked image does not change at all, the hidden data is correctly extracted and at the same time an original image is recovered. After compression, the hidden data is still extracted without error. Experimental results prove that the presented scheme achieves both reversibility and robustness against the predefined distortion.