Without going into why you'd want to do this in the first place; if you want to XOR the modulus with another, there is no need to represent it as a big integer first. You can use Convert.FromBase64String
to get an array of bytes, and XOR those byte for byte.
string firstModulus = "yf4I7 ...etc... HU=";
string secondModulus = "...";
byte[] m1 = Convert.FromBase64String(firstModulus);
byte[] m2 = Convert.FromBase64String(secondModulus);
byte[] xor = new byte[m1.Length];
for (int i = 0; i < m1.Length; i++)
xor[i] = (byte)(m1[i] ^ m2[i % m2.Length]);
string xorString = Convert.ToBase64String(xor);
Edit: I've updated the code to allow m2 to be shorter than the m1 array. The array m2 can be filled from any source. In this example I use a second base64 string, but if you use a regular integer, you can use BitConverter.GetBytes
to convert it to a byte array.
For the record, .NET 3.5 does not have a built-in integer class that is big enough to hold the entire modulus. The whole reason that RSA works is because they are very large numbers. .NET 4 has BigInteger, but you don't need it here.