Most watermarking systems available have only a secret key, which can not be public. But in some applications watermark needs to be retrieved by public keys. How to generating public keys without weakening the performance of the private key is a key problem. In this paper a secret key watermarking system is designed, in which a novel method of generating public keys is proposed. The identifier (ID) embedded can be reliably retrieved using public keys without resorting to the original data. Because only part of embedding information is used in public keys, the above problem is successfully solved. Experimental results show its security and validity.