  In this paper, we define and discuss {\phi}-cyclic code, which may be
regarded as a general form of the ordinary cyclic code. As applications, we
explain how to extend two public key encryption schemes, one is McEliece and
Niederriter's cryptosystem of which is based on error-correcting code theory.
Another one is NTRU public key cryptosystem of which is based on polynomial
ring theory. The main purpose of this paper is to give a more general
construction of NTRU based on ideal matrices and q-ary lattice theory.
