Privacy Issues

IoT devices collect sensitive personal data: when people are at home, what they watch and say, health readings, location and habits. Concerns include constant surveillance, data sharing with third parties, profiling, unclear consent, and data kept longer than needed. Privacy by design means building protection into the system from the beginning, collecting only the data needed (data minimisation) and telling users clearly.

Encryption

Encryption converts readable data (plaintext) into unreadable data (ciphertext) using a key.

  • Symmetric encryption uses the same key to encrypt and decrypt, for example AES (128 or 256 bits). It is fast and suits constrained devices, but the key must be shared safely.
  • Asymmetric encryption uses a public key and a private key pair, for example RSA and elliptic-curve cryptography (ECC), which is lighter and favoured for IoT. It is used for key exchange and digital signatures.
  • TLS/SSL (and DTLS for UDP) protect data in transit between the device and cloud, such as MQTT over TLS on port 8883.
  • Hash functions such as SHA-256 produce a fixed-size fingerprint for integrity. A message authentication code (HMAC) combines a hash with a secret key to prove that the message is genuine and unchanged.

Encrypt data in transit, at rest and, where possible, on the device.

Authentication and Access Control

Authentication proves identity: passwords (with strong rules), pre-shared keys, X.509 certificates per device, tokens (OAuth, JWT), multi-factor authentication for users, and hardware roots of trust such as secure elements. Authorisation limits what each identity may do (least privilege), and secure boot with signed OTA updates ensures only trusted firmware runs.

Data Protection and Anonymization

Data protection includes access control, logging, secure deletion and backups. Anonymization removes the link to a person. Techniques are removing identifiers (names, device IDs), pseudonymisation (replacing identifiers with codes), generalisation (age 27 becomes 20 to 29), aggregation, adding noise (differential privacy) and k-anonymity: each record is identical in its identifying fields to at least k − 1 others, so no person stands out.

Definition: k-anonymity. A privacy property of a data set in which every combination of identifying attributes appears in at least k records, so that any individual cannot be singled out from fewer than k people.

Table 4.2: Security tools for privacy

Goal Tool Example
Confidentiality Encryption (AES, TLS) MQTT over TLS
Integrity Hash, HMAC, signatures Signed firmware
Authentication Certificates, tokens Per-device X.509 certificate
Anonymity Generalisation, k-anonymity Age ranges instead of ages

Example 4.2: k-anonymity of health readings

Problem: A wearable data set has records (age, area code): (23, 1101), (27, 1102), (25, 1103), (41, 1104), (45, 1105), (48, 1106). Generalise age to 10-year ranges and area code to its first two digits. Find the group sizes and the value of k.

Solution:

  1. Ages 23, 27, 25 become 20 to 29; ages 41, 45, 48 become 40 to 49.
  2. All area codes become "11**".
  3. Group (20 to 29, 11**) has 3 records; group (40 to 49, 11**) has 3 records.
  4. The smallest group size is 3, so k = 3.

Result: The data set is 3-anonymous: no record can be told apart from at least two others by age and area code.

import hashlib
rows = [(23, 1101), (27, 1102), (25, 1103),
        (41, 1104), (45, 1105), (48, 1106)]
groups = {}
for age, code in rows:
    key = (age // 10 * 10, str(code)[:2])
    groups[key] = groups.get(key, 0) + 1
print(groups)
print("k =", min(groups.values()))
print("SHA-256 bits:", len(hashlib.sha256(b"t=31").digest()) * 8)

Output

{(20, '11'): 3, (40, '11'): 3}
k = 3
SHA-256 bits: 256

Common mistakes

  • Assuming that removing a name alone makes data anonymous.
  • Sharing one symmetric key among all devices.
  • Using plain MQTT or HTTP across the internet.
  • Collecting more personal data than the service needs.

Key takeaways

  • Symmetric AES is fast; asymmetric RSA and ECC exchange keys and sign.
  • TLS protects data in transit; hash and HMAC protect integrity.
  • Use per-device certificates, least privilege and signed updates.
  • Anonymise: generalise, pseudonymise, k-anonymity, noise.

Practice questions

  1. Differentiate symmetric and asymmetric encryption.
  2. What is the purpose of HMAC?
  3. What is data minimisation?

Answers to the practice questions

  1. Symmetric uses one shared key; asymmetric uses a public and private key pair.
  2. To prove that a message is genuine and unaltered, using a secret key.
  3. Collecting only the data really needed for the service.

Sources

  • Official BCA syllabus Internet of Things, course code 25BCA406DS01, Unit IV