Hello,
I have looked all over the Internet for the answer to this question.

I know that, to send data to the server using SSL, you encrypt it using the servers public key. I also know that the private key is used to decrypt it. What I don't understand is how you can't decrypt it with the public key, i.e. why could a hacker reverse/calculate the reverse of the encryption.

The only way I think it would work is if the public and private key were mathematically smiler/derived from each over. If this is the case, why can't the public key be used to find the private key?

This is all really confusing and I really need to know the answer. My brain will pop if I have to think about it any longer ;) Hope you understand what I am asking here. ;)

Thanks in advance.

The private key can be derived from the public key, but the amount of computing power to do so it prohibitive. For example, if you used RSA you'd have to find the prime factors of a very large number. A quote from Wikipedia is in order here:

"Determining the prime factors of a number is an example of a problem frequently used to ensure cryptographic security in encryption systems; this problem is believed to require super-polynomial time in the number of digits- it is relatively easy to construct a problem that would take longer than the known age of the Universe to calculate on current computers using current algorithms."

The problem in cryptography is not keeping something secret forever, it's keeping it secret long enough to no longer matter.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.