public static string EncryptString(string data, string header, string ipLink, string pass = "", string fileExtension = null) { if (string.IsNullOrWhiteSpace(data)) { data = ""; } ushort passCodeFromString1 = FileEncrypter.GetPassCodeFromString(pass); ushort passCodeFromString2 = FileEncrypter.GetPassCodeFromString(""); StringBuilder stringBuilder = new StringBuilder(); string str = "#DEC_ENC::" + FileEncrypter.Encrypt(header, passCodeFromString2) + "::" + FileEncrypter.Encrypt(ipLink, passCodeFromString2) + "::" + FileEncrypter.Encrypt("ENCODED", passCodeFromString1); if (fileExtension != null) { str = str + "::" + FileEncrypter.Encrypt(fileExtension, passCodeFromString2); } stringBuilder.Append(str); stringBuilder.Append("\r\n"); stringBuilder.Append(FileEncrypter.Encrypt(data, passCodeFromString1)); return(stringBuilder.ToString()); }