1. A method of a first device communicating with a second device in a home network, the method comprising: transmitting, by the first device, predetermined seed information to the second device; sending a user interface (UI) object to the second device on condition that the validity of the first device is verified by the second device using the seed information and personal information input to the second device by a user; receiving, by the first device, a message including secret information encrypted with a predetermined public key from the second device; generating, by the first device, a secret key corresponding to the public key; and decrypting the secret information included in the message by using the secret key, wherein the first device is a remote user interface (RUI) server, and the second device is an RUI client, and wherein the public key is generated based on the seed information and the personal information input to the second device by the user by using the UI object by the second device.