If you had a lot of corrosion on the terminals it may have crept up inside the cable coverings. Give us some more info. about you truck, year, model, engine, etc. Maybe someone has had a similar problem that could help. Good luck.
If it's on the original battery, you should change it out for a new one. A bad cell can cause a lot of issues. OEM batteries are not made to last very long. The trucks eat electricity and burn gas. Buy a good one and drive on.
Sounds to me like an ignition issue/key/mykey issue. It seems like your truck's anti-theft is malfunctioning. The first thing I would do is reset the computer by disconnecting the battery for 10-15 minutes.