Today in my computer class, we learned about ssl and public-key cryptology. I had a question that my teacher couldn't answer though so I'm posting it here. According to the teacher it is impossible to guess the private key based on the public key and it is also impossible to decrypt a message with the public key that was encrypted with the public key. My question is, why is the public key able to encrypt the message but it can't be used to work backwards to decrypt it?