A method for discovering security information, comprising: receiving, by a second device, a broadcast message or a multicast message from a first device in a network in which the second device is located, wherein the broadcast message or the multicast message comprises a request for performing security domain discovery; feeding back, by the second device, a representation of a security domain resource to the first device, wherein the representation of the security domain resource comprises security domain information, and the security domain information comprises a security domain identifier, ID, and a security domain name; wherein feeding back, by the second device, the representation of the security domain resource to the first device, comprises: determining, by the second device, whether security domain discoverability in the representation of the security domain resource stored in the second device is true; and feeding back, by the second device, the representation of the security domain resource in response to that the security domain discoverability is true; otherwise, not feeding back, by the second device, the representation of the security domain resource; and wherein the security domain discoverability is used to indicate whether the security domain information corresponding to the second device can be discovered by other devices; when the security domain discoverability is a first value, the security domain discoverability is not discoverable, and the security domain discoverability is true; and when the security domain discoverability is a second value, the security domain discoverability is discoverable, and the security domain discoverability is false. receiving, by a second device, a broadcast message or a multicast message from a first device in a network in which the second device is located, wherein the broadcast message or the multicast message comprises a request for performing security domain discovery; feeding back, by the second device, a representation of a security domain resource to the first device, wherein the representation of the security domain resource comprises security domain information, and the security domain information comprises a security domain identifier, ID, and a security domain name; wherein feeding back, by the second device, the representation of the security domain resource to the first device, comprises: determining, by the second device, whether security domain discoverability in the representation of the security domain resource stored in the second device is true; and feeding back, by the second device, the representation of the security domain resource in response to that the security domain discoverability is true; otherwise, not feeding back, by the second device, the representation of the security domain resource; and wherein the security domain discoverability is used to indicate whether the security domain information corresponding to the second device can be discovered by other devices; when the security domain discoverability is a first value, the security domain discoverability is not discoverable, and the security domain discoverability is true; and when the security domain discoverability is a second value, the security domain discoverability is discoverable, and the security domain discoverability is false. determining, by the second device, whether security domain discoverability in the representation of the security domain resource stored in the second device is true; and feeding back, by the second device, the representation of the security domain resource in response to that the security domain discoverability is true; otherwise, not feeding back, by the second device, the representation of the security domain resource; and wherein the security domain discoverability is used to indicate whether the security domain information corresponding to the second device can be discovered by other devices; when the security domain discoverability is a first value, the security domain discoverability is not discoverable, and the security domain discoverability is true; and when the security domain discoverability is a second value, the security domain discoverability is discoverable, and the security domain discoverability is false.