Reduces message length of encrypted message to be transmitted selectively
to plurality of decrypting devices. An encrypting device includes a
generating unit for generating node associating information configured to
associate respective terminal nodes in a tree structure with each
decrypting device in relation to a group of decrypting devices enabled
for decryption, a extracting unit for extracting a decryption enabled
node containing decrypting devices in descendant terminal nodes and not
containing a decrypting device with decryption disabled in any of the
descendant terminal nodes, and a unit for encrypting the message by use
of a node encryption key for the decryption enabled node. Decrypting
devices include specifying unit for specifying terminal node associated
with decrypting device based on node associating information, and a
decrypting unit for decrypting encrypted message using a node decryption
key for any decryption enabled nodes ranging from terminal node to root
node thereof.