In Python, I want to use onion routing (e.g. Tor or Torpy) to send messages from A to B, where A is anonymous and B is in the public.
I have watched all possible youtube videos on "python socket" and "python torpy" and "torpy socket" and "socks" and tried all supposedly working solutions on stack exchange and tor stack exchange. The reason why I am asking is that I still have no solution. Also, the packages mostly have no documentation, so there is no chance for me to do anything than criss-cross trying code snippets on the internet or wildly guessing what a snippet could mean and trial-error rearranging according to guess.
Problem Setup: I have two laptops with python. I will run a script A.py on machine A, and B.py on machine B. A knows the IP of B. A sends a message to B. B shall receive the message without knowing who sent it. Supposedly very basic stuff.
# code on A s = node() s.ping(IP_address_of_B) s.send(bytes)
# code on B s = node() s.listen_and_accept() B.recv(bytes)
I now list all the solution that I have already tried.
The issue in these solution attempts is that they either don't work on my machines or I do not know what I did wrong when implementing them (should not matter when being presented with an actual solution to this question), or the one side actively refuses the connection, or there is a time-out, or the message is not received, or B sees the IP address or A anyways. With Torpy I have only been able to connect to very particular websites. Most website addresses result in a time-out.
If an answerer can think of two solutions, the easiest one (measured by things that may have to be installed outside of "pip install xy" and that can be set up or configured incorrectly) is preferred. I build a voting algorithm that ideally every citizen has to be able to install correctly on first try on their machine. Complicated solutions are as worthless as absent solutions.
... [deleted because I do not have 10 reputation]