0
0
Raspberry Piprogramming~20 mins

Why security protects deployed IoT devices in Raspberry Pi - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
IoT Security Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
Output of a simple IoT device authentication simulation
Consider this Python code simulating a Raspberry Pi IoT device checking a password before allowing access. What is the output when the password is 'secure123'?
Raspberry Pi
def authenticate(password):
    if password == 'secure123':
        return 'Access granted'
    else:
        return 'Access denied'

print(authenticate('secure123'))
ANone
BAccess denied
CError: password not defined
DAccess granted
Attempts:
2 left
💡 Hint
Check the condition comparing the password string.
🧠 Conceptual
intermediate
1:30remaining
Why encrypt data on IoT devices?
Why is encrypting data important for deployed IoT devices?
ATo make the device physically stronger
BTo make data unreadable to unauthorized users
CTo increase the device's processing speed
DTo reduce the device's power consumption
Attempts:
2 left
💡 Hint
Think about protecting information from hackers.
🔧 Debug
advanced
2:30remaining
Identify the error in this IoT device firmware update code
This code snippet is meant to check if a firmware update is valid by comparing version numbers. What error will it cause?
Raspberry Pi
current_version = '1.2.3'
new_version = '1.3.0'

if new_version > current_version:
    print('Update available')
else:
    print('No update')
ASyntaxError due to missing colon after else
BTypeError because versions are strings
CNo output because condition is false
DRuntimeError due to invalid comparison
Attempts:
2 left
💡 Hint
Check the syntax of the if-else statement.
🚀 Application
advanced
3:00remaining
Result of running this Raspberry Pi sensor data encryption code
What will be the output of this code that encrypts sensor data using a simple Caesar cipher with shift 3?
Raspberry Pi
def caesar_encrypt(text, shift):
    result = ''
    for char in text:
        if char.isalpha():
            base = ord('a') if char.islower() else ord('A')
            result += chr((ord(char) - base + shift) % 26 + base)
        else:
            result += char
    return result

sensor_data = 'Temp: 25C'
encrypted = caesar_encrypt(sensor_data, 3)
print(encrypted)
AWhps: 28F
BTemp: 25C
CWhps: 25F
DError: unsupported operand type
Attempts:
2 left
💡 Hint
Look at how letters shift by 3 positions, numbers stay the same.
Predict Output
expert
2:00remaining
Output of this Raspberry Pi IoT device network security check
What is the output of this code that checks if a device IP is in the allowed list?
Raspberry Pi
allowed_ips = {'192.168.1.10', '192.168.1.11', '192.168.1.12'}
device_ip = '192.168.1.13'

if device_ip in allowed_ips:
    print('Device allowed')
else:
    print('Device blocked')
ADevice blocked
BDevice allowed
CKeyError
DSyntaxError
Attempts:
2 left
💡 Hint
Check if the device IP is in the set of allowed IPs.