Como Escribir En Un Pdf Protegido

I want to create a raspberrypi doorlock and was thinking about adding 2fa authentication for logging in to ubuntu, but im worried somone can hack the maching with access to the usbport cable. Maybe boot from their own device or insert badUsb. The machine itself is behind the locked door. Only usbport cable, 1, and a keypad, not usb, attached to pins, will be accessable. I was thinking about nfc, rfid reader, but it looks like it is possible to clone the card with physical access.