Shh... Can You Split a Secret? In Applied Cryptography by Bruce Schneier (which I have been reading quite a lot recently), a protocol for splitting secrets is discussed. Here is a brief description:


  
  Trent generates a random byte string, R, the same length as the message, M.
  Trent XORS M with R to make S.
  He gives R to Alice and S to Bob. 
  




Your task is to, given an input, split the input into two output files or print the split secret to STDOUT. One output/part of output should contain the random string; the other should contain the original input XOR'd with the random string. Input and output may be to/from files or to/from STDIN/STDOUT. Outputting to STDERR is also allowed.
There are a few restrictions, however:


Your program must take 1 input (1 input filename &amp; 2 outputs if doing file I/O), and output the random string and the original string XOR'd with that random string into the other.
Your program must be cryptographically secure. All random number generators must be cryptographically secure. For example, /dev/random is fine, but the Mersenne Twister (usually randint(number,number) is not. Any random number generator must be explicitly cryptographically secure.


If you want to know anything more about what "cryptographically secure" means, check here.

Standard rules and loopholes apply.




This is code-golf, so the code with the fewest bytes will win.
May the best coder prosper...
Bash + coreutils + openssl, 91 bytes

0000000: 63 3d 22 6f 70 65 6e 73 73 6c 20 65 6e 63 20 2d  c="openssl enc -
0000010: 61 65 73 2d 31 32 38 2d 63 74 72 20 2d 4b 20 24  aes-128-ctr -K $
0000020: 28 78 78 64 20 2d 70 73 20 2d 6c 20 31 36 20 2f  (xxd -ps -l 16 /
0000030: 64 65 76 2f 72 61 6e 64 6f 6d 29 20 2d 69 76 20  dev/random) -iv
0000040: 30 22 0a 24 63 3c 24 31 0a 74 72 20 01 2d ff 20  0".$c&lt;$1.tr .-.
0000050: 5c 30 3c 24 31 7c 24 63 3e 26 32                 \0&lt;$1|$c&gt;&amp;2


Takes a filename as argument and splits the secret to STDOUT and STDERR. Input and output are in raw binary format.

Sample run

$ cat input.txt
Bruce
$ bash split input.txt 2&gt; &gt;(xxd -ps &gt;&amp; 2) | xxd -ps
d5725c26aa3b
97002945cf31
$ printf %02x $[0xd5725c26aa3b ^ 0x97002945cf31] | xxd -r -ps
Bruce