We're not sure about 1 Peter, but 2 Peter was written 50-100 years after Peter was martyred. The Gospel authors were not identified when written (a sign of arrogance and hubris). The Church put the names on them ca. 225 AD or so, IIRC.
Timothy and Titus and Barnabus could easily have acted as Paul’s secretaries, or scribes. We know from some letters that he used them. the important thing is the theology, it never varies from Paul’s teachings.