Network coding can substantially improve network throughput and performance. However, these codes have a major drawback if the network contains hidden malicious nodes that can eavesdrop on transmissions and inject fake information. In this scenario, even a small amount of information injected by a single malicious hidden node could mix with and contaminate much of the information inside the network, causing a decoding error. We improve on previous work by providing a polynomial-time, rate-optimal distributed network code design that functions even in the presence of a Byzantine adversary with substantial eavesdropping capabilities. As long as the sum of the adversary's jamming rate ZO and his eavesdropping rate ZI is less than the network capacity C, (ZO +ZI < C), our codes attain the optimal rate of C - ZO. The network codes we design are information-theoretically secure and assume no knowledge of network topology. Prior to transmission, no honest node knows the location or strength of the adversary. In our code design, interior nodes are oblivious to the presence of adversaries and implement a classical low-complexity distributed network code design; only the source and destination need to be changed. Finally, our codes work for both wired and wireless networks.