Operating systems 1

Program that generates 4 threads: Tr, Te, Td, e Tw.

  • Tr reads from the keyboard an arbitrarily long sequence of characters (S) until it recognizes the (ENTER) character.
  • Te reads from the device "/ dev / random" a string of characters R of the dimension of S, and subsequently, it makes the XOR byte-by-byte with S obtaining Se = XOR (R, S).
  • Td reads R and Se and compute Sd = XOR(R, Se).
  • Tw stampa prints on screen Sd string.

Source code and full description (in Italian)