We say that an encryption scheme or a signature scheme provides anonymity when it is infeasible to determine which user generated a ciphertext or a signature. To construct the schemes with anonymity, it is necessary that the space of ciphertexts or signatures is common to each user. In this paper, we focus on the techniques which can be used to obtain this anonymity property. First, we propose a new technique for obtaining the anonymity property on RSA-based cryptosystem, which we call ``sampling twice.'' Second, in addition to our new technique, we consider three previously known techniques, that is, repeating, expanding, and using RSACD, for anonymity of cryptosystems based on RSA. We construct previously unproposed schemes for encryption, undeniable and confirmer signature, and ring signature by applying each technique. Then we precisely analyze the properties of these schemes and show their advantage and disadvantage.