1. A method of a first device communicating with a second device in a home network, the method comprising: transmitting predetermined seed information to the second device; receiving a message including secret information encrypted with a predetermined public key from the second device; generating a secret key corresponding to the public key based on the seed information and personal information input to the first device by a user according to a predetermined IBE (identity-based encryption) scheme; and decrypting the secret information included in the message by using the secret key, wherein the public key is generated based on the seed information and the personal information input to the second device by the user according to the IBE scheme by the second device.