We present a chosen-ciphertext attack against both NICE cryptosystems. These two cryptosystems are based on computations in the class group of non-maximal imaginary orders. More precisely, the systems make use of the canonical surjection between the class group of the quadratic order of discriminant -pq2 and the class group of the quadratic order of discriminant -p. In this paper, we examine the properties of this canonical surjection and use them to build a chosenciphertext attack that recovers the secret key (p and q) from two ciphertexts/cleartexts pairs. 1 Overview In [5], Hartmann, Paulus and Takagi have presented a new public-key cryptosystem based on ideal arithmetic in quadratic orders. This system was called NICE, which stands for New Ideal Coset Encryption. In [7], H