Download iPhone5,1_10.3.4_14G61_Restore.ipsw . Extract it. You need to decrypt the 058-56767-034.dmg using img4 and a custom key (found via The iPhone Wiki).
The most significant development in recent years was the discovery of the exploit. This is an unpatchable bootrom exploit affecting devices from the iPhone 4s through the iPhone X. For the iPhone 5, this means you can jailbreak or modify the device on any firmware version permanently. The tool Checkra1n utilizes this exploit to patch the kernel and install Cydia. iphone 5 custom firmware
You now have an iPhone 5 running the OS it was born for. Download iPhone5,1_10