0
0
IOT Protocolsdevops~10 mins

Secure boot and firmware updates (OTA) in IOT Protocols - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to verify the firmware signature before booting.

IOT Protocols
if verify_signature(firmware, [1]):
    boot(firmware)
Drag options to blanks, or click blank then click option'
Apublic_key
Bprivate_key
Cfirmware_hash
Dencryption_key
Attempts:
3 left
💡 Hint
Common Mistakes
Using the private key to verify the signature instead of the public key.
2fill in blank
medium

Complete the code to start the OTA update process securely.

IOT Protocols
ota_update.start_secure_update([1])
Drag options to blanks, or click blank then click option'
Aupdate_url
Bunencrypted_firmware
Cfirmware_version
Dsigned_firmware
Attempts:
3 left
💡 Hint
Common Mistakes
Starting update with unencrypted or unsigned firmware.
3fill in blank
hard

Fix the error in the code that checks firmware integrity using a hash.

IOT Protocols
if firmware_hash == [1](firmware).hexdigest():
    accept_update()
Drag options to blanks, or click blank then click option'
Asign
Bdecrypt
Chashlib.sha256
Dencrypt
Attempts:
3 left
💡 Hint
Common Mistakes
Using encrypt or decrypt functions instead of hashing.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps firmware versions to their hashes for verification.

IOT Protocols
version_hashes = {version: [1] for version in firmware_versions if version [2] '1.0.0'}
Drag options to blanks, or click blank then click option'
Aget_hash(version)
B>
C==
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using equality instead of greater than for filtering versions.
5fill in blank
hard

Fill all three blanks to create a secure OTA update check that verifies signature, version, and hash.

IOT Protocols
if verify_signature(firmware, [1]) and firmware_version [2] current_version and firmware_hash [3] expected_hash:
    apply_update(firmware)
Drag options to blanks, or click blank then click option'
Apublic_key
B>
C==
Dprivate_key
Attempts:
3 left
💡 Hint
Common Mistakes
Using private key for verification, wrong comparison operators, or incorrect hash check.