At the time Norway was invaded by Germany in 1940, Boyesen was a law student and member of the Labour Party. He had also a member of the socialist organization Mot Dag. The Labour cabinet Nygaardsvold fled to London in order to avoid an early capitulation. Germany occupied Norway for five years, whereas Boyesen became a part of the resistance movement. He was a messenger for both the Norwegian government-in-exile and the Norwegian legation in Stockholm, communicating on behalf of the so-called "Kretsen", an inner circle of the resistance movement for which he was the secretary. Within "Kretsen", he cooperated especially close with former Supreme Court Justice Ferdinand Schjelderup. Approaching the winter of 1944, Boyesen was no longer safe in Norway, and fled to Sweden. He worked as a secretary for the Norwegian legation in Stockholm until the liberation of Norway in 1945.