This is simple realization how Diffie-Hellman encrypting algorithm works. Python 3+ required Read more about Diffie-Hellman: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange