public bool ValidateCurrentKey(string Key) { StringCipher Cypher = new StringCipher(); if (Cypher.Encrypt( Key, cypherKey) == GetProperties("admin")) { isAdmin=true; return true; } int noLics = Convert.ToInt32(GetProperties("NumberofMachines")); for (int i = 1; i <= noLics; i++) { if (Cypher.Encrypt( Key,cypherKey) == GetProperties("Mkey" + i.ToString())) { return checkPayments(); } } return false; }
public string GenerateKey(string Mkey) { StringCipher Cypher = new StringCipher(); return Cypher.Encrypt( Mkey,cypherKey); }