@startuml
!pragma teoz true
'autonumber

participant "Fleet management\n service" as FMS
participant "Central control\n unit" as CCU
participant "Human-machine\n interface unit" as HMI
actor "Attacker" as Att #red

FMS -> CCU: new task
activate CCU

alt Bruteforce by user

loop#red unitl pin is responded to be valid
Att -[#red]> HMI: enter pin
HMI -[#red]> CCU: PIN hash
CCU --> HMI: is pin valid
HMI --[#red]> Att: is pin valid
else
note over Att #red: pin found by bruteforce
Att -[#red]> HMI: enter valid pin
&HMI -[#red]> CCU
note over CCU #red: open locker
end

else Bruteforce by HMI

loop#red unitl pin is responded to be valid
HMI -[#red]> CCU: PIN hash
CCU --> HMI: is pin valid
else
note over HMI #red: pin found by bruteforce
HMI -[#red]> CCU: valid pin
note over CCU #red: open locker
end


else with special monitor rules

loop unitl pin is responded to be valid
HMI -[#red]> Monitor: PIN hash
note over Monitor: maximum attempts reached\n no forward to CCU
end

end

deactivate CCU


@enduml