In this letter we present an imperceptible and robust watermarking algorithm that uses a cryptographic hash function in the authentication application of digital medical imaging. In the proposed scheme we combine discrete Fourier transform (DFT) and local image masking to detect the watermark after a geometrical distortion and improve its imperceptibility. The image quality is measured by metrics currently used in digital image processing, such as VSNR, SSIM and PSNR.