There are many algorithms for encrypted transmission. Git can use rsa. A core problem to be solved by rsa is how to use a pair of specific numbers so that one number can be used for encryption and the other number can be used for decryption. These two numbers are the public key that you encounter when using git and github, that is, the public key and the private key.
Among them, the public key is the number used for encryption, which is why you have to upload it to github after generating the public key locally. The data sent back from github and encrypted with the public key can be restored using your local private key.
If your key is lost, whether it is a public key or a private key, you cannot use it if you lose one. The solution is also very simple, just generate it again, and then set it up again in github.com
As we all know, ssh is an encrypted transmission.
There are many algorithms for encrypted transmission. Git can use rsa. A core problem to be solved by rsa is how to use a pair of specific numbers so that one number can be used for encryption and the other number can be used for decryption. These two numbers are the public key that you encounter when using git and github, that is, the public key and the private key.
Among them, the public key is the number used for encryption, which is why you have to upload it to github after generating the public key locally. The data sent back from github and encrypted with the public key can be restored using your local private key.
If your key is lost, whether it is a public key or a private key, you cannot use it if you lose one. The solution is also very simple, just generate it again, and then set it up again in github.com