public static bool BuildLicenseFile(string inputHash) { string encrypted = RijndaelSimple.Encrypt(C_ENHANCED_VERSION_LICENSE, inputHash, RijndaelSimple.saltValue, RijndaelSimple.hashAlgorithm, RijndaelSimple.passwordIterations, RijndaelSimple.initVector, RijndaelSimple.keySize); string desEncryptedHash = RijndaelSimple.AES_encrypt(inputHash, RijndaelSimple.AES_Key, RijndaelSimple.AES_IV); string licenseKey = desEncryptedHash.Substring(0, 32); string encryptedLicense = RijndaelSimple.AES_encrypt(C_ENHANCED_VERSION_LICENSE, licenseKey, RijndaelSimple.AES_IV); File.WriteAllText(C_LICENSE_FILE, encrypted + "\r\n" + desEncryptedHash + "\r\n" + encryptedLicense); // pojedyncza licencja return(true); }