<div dir="ltr">Hi List,<div><br></div><div>I have a somewhat obscure task I'd like the help of a programmer to accomplish:</div><div><br></div><div>I have a TeX document in which each character has been converted to one of 52 two-digit numbers (so, 01 through 52). I have a corresponding keytext document, also a TeX file, with 50,000 two-digit numbers in the same range derived from a random source. This latter is my one-time pad.</div><div><br></div><div>I would like to run xor(mod 52) on the first document through the second, to obtain a third document that is thus properly encrypted. However, since these are TeX documents there are tags, markups, footnotes, citation links, etc. still in the document. </div><div><br></div><div>So what I need is something like a python script that can go through a.tex, perform an xor operation on each subsequent two-digit number in the file through the number in the corresponding position in b.tex, to obtain c.tex with all the TeX stuff still in its proper place. I would also want this process to be reversible (ie, run xor(mod 52) on c.tex through b.tex to obtain a file identical to a.tex). </div><div><br></div><div>I assume this requires some regex work, but writing a script like this is entirely out of my competence.</div><div><br></div><div>Is there anybody on the list with some familiarity with this kind of programming who'd be able to help me with this project?</div><div><br></div><div>Thank you in advance for your help.</div><div><br></div><div>Cheers,</div><div><br></div><div>A</div></div>