/* * CREATE_POST_KEYS * @function Creates 'secret_key' used to secure data. * @return string */ private static string[] post_key() { //CRYPTOGRAPHY_USE Cryptography cryptgraph = new Cryptography(); //RANDOM_OBJECT Random rand = new Random(); //POST_KEY string key = rand.Next(99999).ToString(); //SECRET_KEY_MD5_CONVERSION string tempKey = (cryptgraph.doHASH("sha1", key.ToString())).ToLower(); string secretKey = (cryptgraph.doHASH("md5", tempKey)).ToLower(); string[] retKeys = new string[] { key, secretKey }; return(retKeys); }
/* * CREATE_SECURE_MESSAGE * @function ... * @return string */ private static string secureRet(string str, string key) { Cryptography cryptgraph = new Cryptography(); return(cryptgraph.doHASH("sha1", str + key));; }
public static string clientKey() { string key = cryptgraph.doHASH("ap", cryptgraph.doHASH("sha1", cryptgraph.StringCleaner(cryptgraph.doHASH("sha512", GetHWID())))); //NKEY_UNMODIFIED return(cryptgraph.qEncode(key)); //NKEY_ENCODED }