Aiming at the needs of multimedia information security and copyright protection, this study combines the ElGamal public key crypto system with Patchwork digital watermarking algorithms to propose a new homomorphic ciphertext domain-commutative watermarking encryption algorithm. The algorithm maps the operation of embedding the watermark in the plaintext domain to the ciphertext domain based on the multiplicative homomorphism of ElGamal, swapping the operations of encryption and embedding watermark. The watermark can be extracted in the ciphertext domain or in the plaintext domain. The experimental results show that the order of embedding watermarks and encrypting data does not affect the generation of ciphertext data containing watermarks and the extraction of watermarks from ciphertext and plaintext, which ensures the confidentiality of embedding watermarks and the security of multimedia data in distribution management. Also, the comprehensive performance of watermarking algorithms is improved.