Method and apparatus for performing secured communication

PURPOSE: A method and an apparatus for implementing a security communication are provided to set security communication channels independent of an UPnP controller by using a URL(Uniform/universal Resource Locator) and a port number. CONSTITUTION: A security communication request is received from a second device(110). A security key for security communication is randomly generated(120). The security key is randomly generated by using at least one of a number and a character. The encoded data is transmitted to and received from the second device by using the security key(130). The first and second devices transmit and receive the encoded data of the authentication messages and the data requested by the user.