0

I visited Whose key is used to encrypt a HTTPS response?.

I came to know that a public key encrypts data and a private key decrypts that data.

It makes sense when I think that GitHub needs the public key to encrypt code in the repo when I try to pull that code from that repo.

But what about push? I have the public key to encrypt my data (that i want to push to my repository)....but GitHub doesn't have the private key to decrypt my pushed data. But still...GitHub push works using ssh...

So my question is: Why GitHub doesn't need my private key to decrypt my data that I push to my GitHub repo?

ashuvssut
  • 1,725
  • 9
  • 17
  • 1
    I think what you are looking for is here [Already Answered](https://stackoverflow.com/questions/28479567/why-does-github-only-need-my-public-key-in-order-to-push#:~:text=The%20general%20idea%20in%20a,t%20need%20your%20private%20key.) – Pankaj Yadav Sep 07 '20 at 04:41
  • Thanks @PankajYadav I have flagged the post. – ashuvssut Sep 07 '20 at 05:32
  • @PankajYadav One out-of-the-topic question... Your `:~:text=` syntax on the URL doesnt seem to focus to that post that you tried to focus. I also tried the same many times...seems like `:~:text=` doesnt work sometimes. Do you know what is this `:~:text=` called? – ashuvssut Sep 07 '20 at 05:36

1 Answers1

0

As suggested by @PankajYadav

ref: Why Does GitHub only need my public key in order to push?

GitHub is not at all interested in sending/receiving encrypted data. GitHub just wants to authenticate the user using the public key that the user provided to GitHub.

ashuvssut
  • 1,725
  • 9
  • 17