In this paper, we have proposed new variants of the El-Gamal and the Cramer-Shoup encryption schemes. In our schemes, the anonymity property holds even if each user chooses an arbitrary prime q where |q| = k and p = 2q+1 is also prime. More precisely, our El-Gamal variants provide anonymity against the chosen-plaintext attack, and our Cramer-Shoup variants provide anonymity against the adaptive chosen-ciphertext attack. These anonymity properties are proved under a slightly weaker assumption than the DDH assumption. Furthermore, our El-Gamal variants are secure in the sense of IND-CPA, and our Cramer-Shoup variants are secure in the sense of IND-CCA2.