/* * Created by SharpDevelop. * User: Jezzon * Date: 2012-01-15 * Time: 02:20 * * To change this template use Tools | Options | Coding | Edit Standard Headers. */ using System; namespace ships { /// /// Description of Xor. /// public class Xor { private static byte[] StrToByteArray(string str) { System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); return encoding.GetBytes(str); } private static string ByteArrayToString(byte[] array) { System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); string str = enc.GetString(array); return str; } public static string StrXOR(string str, string xor) { Byte[] tmpStr=StrToByteArray(str); Byte[] tmpXor=StrToByteArray(xor); for(int i=0;i