Then Iesous, having come to the region of Kaisareia of Philippos, was interrogating his students, saying, Whom do men proclaim to be the Son of Man? And they said, Some Ioannes the Immerser, and others Elias, and others Ieremias or one of the prophets.
He says to them: But who do you proclaim me to be? And Simon Rock responded, saying, You are the Anointed, the Son of the Living God.
Then Iesous responded to him, saying, Blessed are you, Simon Bariona. For flesh and blood did not unveil it to you, but my Father who is in the heavens. And so also I to you proclaim that you are Rock, and on this rock-material I will construct my assembly, and the gates of Hades will not overpower it. I will give to you the keys of the realm of the heavens, and whatsoever you bind on the earth shall be bound in the heavens, and whatsoever you loose on the earth shall be loosed in the heavens.
Then he admonished his students that no one should say that he is the Anointed. From that time Iesous Anointed began to show to his students that he ought to go to Hierosolyma to go away, and to endure many things from the elders and chief priests and scholars, and to be killed and on the third day to be wakened. And, having taken to him to himself, Rock began to admonish him, saying, Let it go, Lord; this will not ever happen to you.
And, having turned his back, he said to Rock, Retreat behind me, Satanas! You are a stumblingblock to me, for your thoughts are not on God's things but on human things.
[Matthew 16:13-23, my rough translation. Notice the pattern of proclamation: Whom do men proclaim the Son of Man to be? Whom do you proclaim Me to be? I proclaim you to be Peter.
Jesus's comment in v. 17 about the confession being revealed to Peter from his Father in heaven is very likely a reference back to 16:1, when the Pharisees and Sadducees were demanding a sign from heaven; Jesus then deliberately wants the disciples in v. 21 to hide this revelation from heaven from the Pharisees and Sadducees. Jesus's naming of Peter uses Petros and petra; they can be synonyms, just differing by grammatical gender, but in some contexts they are not exact synonyms; petra can mean not just a particular rock but an entire rock formation, for instance, but given the whole sentence, another association is definitely in view -- namely, petra can specifically suggest rock for building. Thus my translation of it as 'rock-material'. 'Assembly' is the literal meaning of ekklesia, the word for 'church'; it means a collection or council of selectmen. The word for 'wakened' literally means 'raised', which is why it is often translated that way, but the root word is 'rise' in the sense we use when we say, 'when you rise in the morning'.
The Church Fathers divided over whether 'this petra' meant Christ as confessed by Peter, Peter's confession of Christ, or Peter as confessing Christ. All three interpretations are consistent with what the passage actually says, and my own inclination is to agree with Soloviev in Russia and the Church when he argues that as ancient naming practices are often multi-level in their use of meanings, the most reasonable interpretation is to take it as meaning all three together, so that the three interpretations are just emphasizing different aspects of one thing. Giving someone keys is not a minor matter; locks in this period are custom-made items requiring a skilled metalworker, and giving keys to someone was very commonly putting them in charge. (Indeed, it continued that way at least as late as the Renaissance, when a surprising amount of fighting occurred over who would have possession of the keys of various fortress, since having the keys to the fortresses made you de facto governor.) That something like this is in view is very clear, given that 'binding' and 'loosing' are both also legal terms, and could be translated as 'compel' and 'annul'.
For some reason, I always forget that when Jesus says, "Get behind me" to Peter, he literally turns his back on him.]