An encryption method for encrypting data for multi-level access control in
an ad-hoc network including hierarchical security classes includes
encoding data into a predetermined code using a first public key of a
highest security class, adding a private key of a security class to which
a user belongs, to the predetermined code, and generating a ciphertext by
adding a second public key, published by the security class to which the
user belongs, to the addition result. A corresponding decryption method
includes subtracting the private key from the ciphertext, performing a
first decoding using a secret key known by a security class, to which a
receiver belongs, by the receiver of the ciphertext, and correcting
errors included in the second public key and detecting the data by
performing a second decoding of the result of the first decoding using a
code known by the security class to which the receiver belongs.