function res = getxor (cipher, pos, bigraph)
    bytes = cast (bitxor (cipher ([pos, pos + 1]), bigraph), "uint16");
    res = bytes(1) * 256 + bytes(2);
endfunction
