public static long DecryptNumber(string Encrypted) { int[] aKey = GetKeyForEncryptNumber(); int Antilog = GetAntilogForEncryptNumber(); string[] aEncrypted = CArray.SplitByLength(Encrypted, 1); for (int i = 0; i < aEncrypted.Length; i++) { aEncrypted[i] = (CMath.Get10FromN(aEncrypted[i], Antilog) ^ aKey[i % 10]).ToString(); } return(Convert.ToInt64(string.Join("", aEncrypted))); }
public static string EncryptNumber(long Decrypted) { int[] aKey = GetKeyForEncryptNumber(); int Antilog = GetAntilogForEncryptNumber(); string sDecrypted = Decrypted.ToString(CFindRep.Repeat('0', aKey.Length)); string[] aDecrypted = CArray.SplitByLength(sDecrypted, 1); for (int i = 0; i < aDecrypted.Length; i++) { aDecrypted[i] = CMath.GetNFrom10((Convert.ToInt32(aDecrypted[i]) ^ aKey[i % 10]), Antilog); } return(string.Join("", aDecrypted)); }