A digital signature is verified using an algorithm that takes three inputs: the message, the digital signature (message encrypted with private key)* and the public key. If the public key is used to verify the original message to the signature, than
logically the algorithm must contain a method to tranform the public key into the private key, so that verification may take place. This would imply a method to get the private key from the public key, which defeats the purpose.
Can someone explain to me how the algorithm is implemented to avoid this problem?
*as explained by Mike below, the signature is actually a digest of the message encrypted with the private key
I think "logically" was a poor choice of words. I meant to say it seemed "intuitive" that the only way to decrypt the signature would be to convert the public key to the private key. Obviously this would compromise the confidentiality of the private key and "defeat the purpose." In light of that I was trying to understand how the public key verifies the signature without conversion to private key. I need help with the math because asymmetry is not intuitive.
Digital signatures aren't the same as key exchange. As far as I can tell, in a broad sense, the former uses the public key to "decrypt/verify" the message, while the latter uses the private key to "decrypt" the exchanged symmetric key (which was "encrypted" using the associated public key).