Your title is confusing between the 2 model years listed, but here's what I can suggest. Either way it sounds like a worn out ignition key cylinder that is just worn out. However, the '97 pickups have the steering wheel lock feature when the key is in the off position. You might want to try moving the steering wheel side to side and see if it is bound up on the locking mechanism. If it's a 2005 truck, that isn't the case and it is most likely a bad key cylinder
Answers & Comments
Your title is confusing between the 2 model years listed, but here's what I can suggest. Either way it sounds like a worn out ignition key cylinder that is just worn out. However, the '97 pickups have the steering wheel lock feature when the key is in the off position. You might want to try moving the steering wheel side to side and see if it is bound up on the locking mechanism. If it's a 2005 truck, that isn't the case and it is most likely a bad key cylinder