I'd like to know this aspect in the inner working of Tor network. Right now I'm unable to find documentation that solves this, although by logic I guess the answer is 'no' I'd like to know for sure.
I'm meaning the following:
Maybe Tor Network works this way for the message in the first node:
clear message->>> First router (clear message is encrypted).
But I think it might also be posible to work in that way, although I've serious doubts about it, as this is something that might pose security risks:
Initial request to Tor network-> First router receives request-> First router sends "something" to the client that allows to encrypt the message as long as it's directed to this IP-> Client creates clear message-> Message is automatically encrypted in client due to that "something"-> First router (message is just transmited through it).
This seems somehow insecure, but as long as the "something" only allows to modify the data of something that would just go to its address it's not that horrible, another thing would be if it allowed to modify any tcp/ip packet that would be insanely horrible from a security perspective.
How does Tor network work in that aspect? Would it be even possible for any server to do something as the second option I'm mentioning?