I am developing a messaging application, more like a chat, in python just to teach my self how sockets work and to learn more about cryptography in general by using PyCrypto.
About my application:
The main purpose of this application cryptographic-wise is to secure messages sent over internet using an asymmetric encryption. Since I am doing this to increase my knowledge concerning cryptography I want it as secure as possible. In this application a client connects to a server and is added to a list holding all currently connected users. The client can now send a message to the server which echoes the message out to all other connected users.
As a small disclaimer: I am fairly new to encryption in general and there is a couple of things I cant wrap my head around. I cant quite figure out how I should distribute the public keys so that an asymmetric encryption can be used to secure messages sent to the server. From what I've read, there is supposed to be some kind of a server I can retrieve generated keys from but I cant seem to find such a service.
Also, if I would be able to retrieve a public key from a key server, how should I generate a private key so that it can be decrypted?
All help, suggestions and corrections are greatly appreciated!