I have a question about public key encryption if the the following example of how things play out is essentially correct. Then I wonder where I can find the implementations of the three algorithms which I call KG1, EA1, and DA1 and about how many lines of code each is.
Alice wants to get messages securely. She uses a key generation algorithm KG1 to create private key "C2A836B33FF1E" and public key "35B1AC692" and publishes the public key to the world.
Bob puts the input of his message "HELLO FROM BOB" and the public key "35B1AC692" into encryption algorithm EA1 which yields the string "DF1537532CB23B" and sends this string to Alice. Chuck intercepts a copy too.
Alice has a decryption algorithm DA1 that can take as input the string "DF1537532CB23B" and her private key "C2A836B33FF1E" and yield output "HELLO FROM BOB", but since Chuck doesn't have the private key "C2A836B33FF1E", he can't convert "DF1537532CB23B" into "HELLO FROM BOB". Also, though Chuck knows the KG1 algorithm and the public key "35B1AC692", he can't use this information to work back to the private key.