An IoT device according to an embodiment encrypts IoT data using a peripheral device and transmits the IoT data to a server, and a user device requests and obtains necessary IoT data from the server, thereby achieving real-time IoT data sharing. The IoT device performs only relatively low-performance operation of attribute-based encryption to encrypt IoT data collected through a sensor and outsources the remaining high-performance operations of attribute-based encryption to the peripheral device providing external communication network connection to the IoT device to generate a final ciphertext. A user device generates an attribute bloom filter using an access policy thereof, requests and obtains IoT data encrypted according to attribute-based encryption. A cloud server receives and stores IoT data encrypted by the IoT device and the peripheral device according to attribute-based encryption and transmits IoT data retrieved using the attribute bloom filter as a query to the user device.