In this paper, security evaluation of an important watermarking class based on quantization is given. Theoretical developments and practical simulations are used to measure the security level of watermarking techniques. We give the contribution of each observation available to the attacker on the total gathered information about the watermarking secrecy. By leading on watermarking technique weaknesses, we find that using the Quantization Index Modulation (QIM) with continuous secret key is equivalent to using a secret key with two states. The latter is easier to estimate than a continuous key. Then, we propose a secure version of a classical trellis coded quantization watermarking. The security is guaranteed thanks to the trellis path generated from the discrete key and the message. We show that the spread transform can represent a second or alternative security level for watermarking systems. It allows to increase the watermarking security level and to keep the embedded message hard ...