Public and Private Key encryption

Hey, I know how it works, but i can't understand how to generate a public and private key, yes i know there are tools to do it, but i am a programmer, what do you expect :)
Knowing how it works implies knowing how to generate keys.

You will need a bignum library to handle the numbers, and a good way to ensure primality.

If you are looking to do it yourself, you can use either GMP (a heavyweight library, at http://gmplib.org/ ) or ttmath (lightweight, at http://www.ttmath.org/ ).

Hope this helps.
Thank you for the speedy response, but i don't think i expressed myself clearly. Lets say i have two prime numbers as keys - keeping it trivial 5 and 7 - and i have the message "hello" how would i encrypt it so that given the other key it can decrypt it.
Perhaps googling for open source encryption implementations would prove instructive.
It sounds to me like you need to spend a lot more time working with the basics of public-key cryptography.

Unless I am misunderstanding something you are asking.
The problem with that is that being new to C++ it would take me ages to find the code of interest and then longer to interpret it.
Lets say i have two prime numbers as keys - keeping it trivial 5 and 7 - and i have the message "hello" how would i encrypt it so that given the other key it can decrypt it.


If you don't know that, than what about the encryption method do you know?
Topic archived. No new replies allowed.