Method and system for anti-hijacking local loopback auditing of streaming media based on a shipboard hardware gateway

CN123020143APending Publication Date: 2026-10-30SHANGHAI FUSIDI MARITIME TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611132963.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

然而,这些方案存在明显的物理安全漏洞:攻击者可以在本地操作系统安装虚拟摄像头驱动(如OBS)、篡改浏览器API接口或截获网络层视频流,从而注入预先录制的伪造视频,欺骗前端在线考试或培训系统

Benefits of technology

从根本上杜绝软件层篡改:通过网关在网络层强制接管视频流,并直接在硬件层嵌入基于私钥签名的水印,使得任何试图通过软件伪造或替换视频流的行为,都无法生成合法的数字签名,从而被公钥验签过程轻松识破。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123020143A_ABST
    Figure CN123020143A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on shipborne hardware gateway's streaming media anti-hijacking local loopback auditing method and system, belong to network security and streaming media anti-cheating field, to solve the problem that software anti-cheating scheme is easily attacked by video stream hijacking under the offline environment of ocean-going ship.The method comprises the following steps: the streaming media request of terminal equipment is intercepted by shipborne hardware gateway and is routed and redirected to itself;Gateway obtains physical space-time data and generates watermark feature code by signing with private key, embeds watermark feature code and original data in the transform domain coefficient of video frame;Loopback is sent to target application server;Server extracts watermark feature code and original data, and verifies signature with gateway public key;If verification fails, gateway triggers network layer physical channel blocking operation to force interrupt terminal network connection.The application realizes unforgeable streaming media authenticity verification and real-time anti-hijacking through hardware-level watermark and network layer blocking, and is suitable for offline environment such as ocean-going ship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of network security and anti-fraud technology for streaming media, and in particular to a method and system for local loopback auditing of streaming video streams based on shipboard hardware gateways in offline or no-internet environments on ocean-going vessels. Background Technology

[0002] With the increasing prevalence of remote education, online examinations, and remote identity verification on ocean-going vessels, ensuring the authenticity of crew members' identities when taking exams or training offline and preventing cheating such as proxy exams and facial recognition has become an urgent problem to be solved.

[0003] Existing anti-cheating solutions largely rely on software-level protection measures, such as disabling virtual camera drivers at the operating system level, intercepting API calls at the browser level, or performing log reconciliation at the application level. However, these solutions have significant physical security vulnerabilities: attackers can install virtual camera drivers (such as OBS) on the local operating system, tamper with browser API interfaces, or intercept network layer video streams, thereby injecting pre-recorded forged videos to deceive the front-end online examination or training system. Since ocean-going vessels are often in environments without internet access or with weak internet connections, post-event software reconciliation mechanisms are difficult to implement in real time. Once the video stream is hijacked, the physical authenticity of the collected streaming media data cannot be guaranteed.

[0004] Therefore, there is an urgent need for a streaming media anti-hijacking auditing solution that can provide hardware-level security in offline environments. Summary of the Invention

[0005] To address the technical problems existing in the prior art, this invention provides a local loopback auditing method and system for preventing hijacking of streaming media based on a shipborne hardware gateway, so as to achieve dual protection of the authenticity and immutability of streaming media data from both the network layer and the hardware layer.

[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: On the one hand, this invention provides a local loopback auditing method for preventing streaming media hijacking based on a shipborne hardware gateway, comprising the following steps: Step S1: The shipborne hardware gateway intercepts the streaming media request initiated by the terminal device and performs route redirection within the local area network, forcibly routing the video stream corresponding to the streaming media request to the internal processing module of the shipborne hardware gateway. Step S2: The shipborne hardware gateway acquires the current physical spatiotemporal data and signs the physical spatiotemporal data using the asymmetric private key built into the shipborne hardware gateway to generate a digital watermark feature code. Step S3: The shipborne hardware gateway embeds the digital watermark feature code and the physical spatiotemporal data into the transform domain coefficients of each frame of the video stream to obtain a watermarked video stream. Step S4: The shipborne hardware gateway sends the watermarked video stream back to the target application server on the terminal device via the local area network loopback. Step S5: The target application server extracts the digital watermark feature code and the physical spatiotemporal data from the received watermarked video stream, and uses the pre-stored public key of the shipborne hardware gateway to verify the signature with the physical spatiotemporal data as the message and the digital watermark feature code as the signature, and sends the verification result to the shipborne hardware gateway. In step S6, after receiving the signature verification failure result, the shipborne hardware gateway determines that a hijacking attack has occurred, triggers a network layer physical channel blocking operation, and forcibly interrupts the network connection of the terminal device.

[0007] Furthermore, the physical spatiotemporal data mentioned in step S2 includes at least: the current absolute time, geographical location coordinates, and the hardware identifier of the shipborne hardware gateway.

[0008] Furthermore, the geographical coordinates are obtained through a multi-constellation global navigation satellite system (GNSS) chip, which simultaneously supports GPS, BeiDou, and GLONASS signal reception.

[0009] Furthermore, when the multi-constellation GNSS chip fails to acquire valid satellite signals, the shipborne hardware gateway automatically switches to a fault-tolerant mode. The current time is obtained by reading the high-precision temperature-compensated crystal oscillator real-time clock (RTC) built into the shipborne hardware gateway. Real-time acquisition of heading beacon data and log speed data from the ship's backbone network NMEA2000 bus; The current geographic coordinates are dynamically estimated using dead reckoning and used as replacement values ​​for the geographic coordinates.

[0010] Furthermore, the transform domain coefficients mentioned in step S3 are the intermediate frequency coefficients of the Discrete Cosine Transform (DCT).

[0011] Furthermore, the network layer physical channel blocking operation described in step S6 specifically includes: The firewall kernel of the shipborne hardware gateway destroys all internal network communication sockets of the terminal device; and / or The shipborne hardware gateway continuously sends hardware-level TCP reset messages to the terminal device to forcibly disconnect the network connection.

[0012] Furthermore, the method also includes step S7: for watermarked video streams that have passed verification, the shipborne hardware gateway packages its watermark hash digest into an encrypted audit package, which is then asynchronously uploaded to the shore-based server after the network is restored.

[0013] On the other hand, the present invention provides a local loopback auditing system for preventing streaming media hijacking based on a shipborne hardware gateway, comprising a shipborne hardware gateway and a target application server; the shipborne hardware gateway is deployed in the ship's local area network as a routing control node; the target application server is deployed on the terminal device; wherein... The shipborne hardware gateway includes: The routing redirection module is used to intercept streaming media requests initiated by terminal devices and force the corresponding video stream to be routed to the internal processing module. The physical spatiotemporal data acquisition module is used to acquire current physical spatiotemporal data; An asymmetric key storage module is used to store the asymmetric private key and public key of the shipborne hardware gateway; The watermark generation module is used to sign the physical spatiotemporal data using the asymmetric private key and generate a digital watermark feature code. The watermark embedding module is used to embed the digital watermark feature code and the physical spatiotemporal data into the transform domain coefficients of each frame of the video stream to obtain a watermarked video stream. The loopback transmission module is used to loopback the watermarked video stream to the target application server on the terminal device via a local area network. The network blocking module is used to trigger a network layer physical channel blocking operation when a signature verification failure signal is received, thereby forcibly interrupting the network connection of the terminal device. The target application server includes: A public key storage module is used to pre-acquire and store the public key of the shipborne hardware gateway; The watermark extraction module is used to extract the digital watermark feature code and the physical spatiotemporal data from the received watermarked video stream. The signature verification module is used to verify the signature using the pre-stored public key of the shipborne hardware gateway, with the physical spatiotemporal data as the message and the digital watermark feature code as the signature, and then sends the signature verification result to the network blocking module of the shipborne hardware gateway.

[0014] Furthermore, the physical spatiotemporal data acquisition module includes a multi-constellation GNSS chip, which simultaneously supports GPS, BeiDou, and GLONASS signal reception. The module also includes a dimensionality reduction fault-tolerant unit, used to read the high-precision temperature-compensated crystal oscillator RTC clock built into the shipborne hardware gateway when the multi-constellation GNSS chip cannot acquire valid satellite signals. It also acquires heading beacon data and log speed data from the ship's backbone network NMEA2000 bus, and dynamically estimates the current geographic coordinates using dead reckoning.

[0015] Furthermore, the network blocking module is specifically used to: destroy all internal network communication sockets of the terminal device through the firewall kernel, and / or continuously send hardware-level TCP reset messages to the terminal device.

[0016] Furthermore, the shipborne hardware gateway also includes an audit packaging module, which is used to encrypt and package the watermark hash digest of the watermarked video stream that has passed the verification, generate an encrypted audit package, and asynchronously upload it to the shore-based server after the network is restored.

[0017] The beneficial effects of this invention are: To fundamentally prevent software-level tampering: By forcibly taking over the video stream at the network layer through the gateway, and directly embedding a watermark based on private key signature at the hardware layer, any attempt to forge or replace the video stream through software will be unable to generate a valid digital signature, and will thus be easily detected by the public key verification process.

[0018] It provides unforgeable physical evidence of authenticity: the watermark contains information strongly correlated with the physical world (time, location) and is signed with a hardware private key, which is protected by hardware and cannot be stolen. This provides the ultimate, undeniable chain of evidence for ocean-going compliance audits.

[0019] The system combines real-time network blocking with post-event traceability: It can block cheating behavior in real time and forcefully at the network level through the "TCP RST message / destroy socket" mechanism, and it can also provide a complete and tamper-proof audit evidence package after the event through the asynchronous reconciliation mechanism, thus achieving full lifecycle security protection.

[0020] It possesses extremely high environmental adaptability and robustness: By introducing a multi-constellation GNSS chip and a dead reckoning algorithm fault-tolerant mechanism, the system can operate stably even in extreme cases where GPS signals are completely lost, greatly enhancing its reliability and practicality in complex ocean environments. Attached Figure Description

[0021] Figure 1 The flowchart illustrates a local loopback auditing method for preventing streaming media hijacking based on a shipborne hardware gateway, as provided in this embodiment of the invention.

[0022] Figure 2 This is a structural block diagram of a local loopback audit system for streaming media anti-hijacking based on a shipborne hardware gateway, provided in an embodiment of the present invention. Detailed Implementation

[0023] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0024] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0025] Example 1 Reference Figure 1 This embodiment provides a local loopback auditing method for preventing streaming media hijacking based on a shipborne hardware gateway. This method is executed in the offline local area network environment of an ocean-going vessel and includes the following detailed steps: Step S101: Streaming media request interception and route redirection.

[0026] The shipboard hardware gateway (hereinafter referred to as the "gateway") serves as the core routing node of the ship's local area network (LAN). It runs an embedded Linux operating system and integrates a Netfilter / IPTables firewall kernel. The gateway monitors all network traffic within the LAN in real time.

[0027] When a crew member opens the online examination system's webpage on a terminal device (such as a Windows PC), and the browser initiates a streaming media request using the RTSP or WebRTC protocol to the remote server, the gateway's DNS hijacking module first intercepts this DNS resolution request. The gateway returns a forged DNS response, resolving the target domain name to the gateway's own LAN IP address (e.g., 192.168.1.1). Simultaneously, the gateway's port redirection rules (implemented via IPTables' DNAT rules) forcibly forward all packets destined for a specific port on the target server (such as the default RTSP port 554 or the UDP port range for WebRTC) to the corresponding port of the "Streaming Media Defense Security Kernel" module listening inside the gateway.

[0028] Through the above operations, the video stream originally destined for the internet is forcibly routed to the gateway, completely severing the path for any software layer on the terminal device's operating system (such as the virtual camera driver OBS, browser plugins, etc.) to directly tamper with the video stream at the network protocol layer. At this point, the original video stream captured by the camera on the terminal device is actually taken over by the gateway, rather than going directly to the browser.

[0029] Step S102: Obtain physical spatiotemporal data and generate digital watermark feature codes.

[0030] The gateway's physical spatiotemporal data acquisition module has begun operation. This module contains the following hardware components: Multi-constellation GNSS chip: It adopts u-blox ZED-F9P or equivalent multi-band multi-constellation chip, which can simultaneously receive GPS L1 / L2, Beidou B1 / B2 and GLONASS G1 / G2 signals, and the positioning accuracy can reach sub-meter level.

[0031] High-precision temperature-compensated crystal oscillator (RTC): Employs a DS3231 or equivalent RTC chip with an annual error of less than ±2 minutes, providing an accurate time reference in the event of GNSS failure.

[0032] Hardware Security Module (HSM): Used for secure storage of the gateway's asymmetric key pair (private key and public key), the private key never leaves the module.

[0033] The gateway obtains the following physical and spatiotemporal data: Current absolute time: preferentially obtained from the UTC time output of the GNSS chip, with millisecond precision. If the GNSS fails, it is read from the RTC.

[0034] Geographic coordinates: The latitude and longitude are parsed from the NMEA0183 statement of the GNSS chip (format: DDMM.MMMM, for example: 3112.3456,N,12134.5678,E), with the precision retained to four decimal places.

[0035] Hardware identifier: Read the MAC address of the gateway network card (e.g., 00:1A:2B:3C:4D:5E).

[0036] The gateway concatenates the three data points into a single string, for example: "20260716143025 | 3112.3456,N, 12134.5678,E | 00:1A:2B:3C:4D:5E". Then, the watermark generation module uses the asymmetric private key in the HSM (employing either ECDSA P-256 or RSA-2048 algorithms) to perform a signature operation on this string, generating a fixed-length digital signature sequence (e.g., a 64-byte ECDSA signature), which is the dynamic watermark feature.

[0037] Because the private key is stored only within the gateway's HSM (Hardware Service Controller), and the HSM has physical tamper-proof features, the private key cannot be obtained from outside. Therefore, no one can forge a legitimate watermark signature, ensuring the watermark's unforgeability.

[0038] Step S103: Embed the watermark feature code into the transform domain coefficients of the video frame.

[0039] The gateway's video processing unit (VPU) takes over the raw video stream. Assume the video stream is an H.264 encoded stream at 30fps, 1080p resolution, and YUV420 color space.

[0040] For each frame of video image, the VPU performs the following operations: Divide the image into 8×8 pixel macroblocks.

[0041] Perform a Discrete Cosine Transform (DCT) on the luminance component (Y) of each macroblock to obtain an 8×8 DCT coefficient matrix.

[0042] Two different frequency regions in the DCT coefficient matrix were selected as embedding locations: The first group (mid-frequency coefficient region): for example, 16 coefficients with coordinates between (2,2) and (5,5) are used to embed watermark feature codes (signature values).

[0043] The second group (low-frequency coefficient region or another group of mid-frequency coefficients): for example, four coefficients with coordinates between (1,1) and (2,2), used to embed the original physical spatiotemporal data string (e.g., compressed binary form).

[0044] The 64-byte watermark feature code generated in step S102 is converted into a binary bit stream (512 bits). For each bit, the value of the first group of intermediate frequency coefficients is fine-tuned using Quantization Index Modulation (QIM).

[0045] Meanwhile, the original physical spatiotemporal data string (e.g., "20260716143025 | 3112.3456,N,12134.5678,E | 00:1A:2B:3C:4D:5E") is compressed and encoded (e.g., using UTF-8 encoding and truncating the first 128 bytes), converted into a binary bit stream, and embedded into the second set of coefficients using the same QIM method.

[0046] Repeat the above operation for all macroblocks until all watermark signatures and original data have been embedded.

[0047] The modified DCT coefficient matrix is ​​subjected to inverse discrete cosine transform (IDCT) to recover the pixel-domain image, which is then re-encoded into an H.264 stream.

[0048] In this step, the VPU only performs the watermark embedding operation and does not perform global AES encryption on the entire video stream. The video stream with the embedded watermark still maintains the standard H.264 encapsulation format and is transmitted through normal streaming media protocols.

[0049] Step S104: Loopback and send the watermarked video stream to the target application server.

[0050] The gateway's loopback sending module sends the watermarked video stream generated in step S103 to the target application server on the terminal device via the loopback interface of the local area network or directly via Layer 2 forwarding.

[0051] The target application server is a background service process running locally on the terminal device (e.g., a local HTTP server developed based on Node.js or Python Flask), listening on a specific port (e.g., 8080) of 127.0.0.1. Upon startup, this server has pre-acquired and stored the gateway's public key certificate via a secure channel (e.g., the initial TLS handshake or a pre-configured configuration file). The public key certificate contains the gateway's public key and is issued by the root CA of the shipowner or shore-based management center to ensure the authenticity of the public key.

[0052] Step S105: Extract the watermark and verify the signature.

[0053] After receiving the watermarked video stream, the target application server performs the following operations: Watermark Extraction: The watermark extraction module performs transform domain analysis on each frame of video image, which is the reverse of the embedding process. It also divides the image into 8×8 macroblocks, performs DCT transform, extracts a 512-bit watermark feature code from the first set of intermediate frequency coefficient regions, and extracts the original physical spatiotemporal data string from the second set of coefficient regions.

[0054] Signature Verification: The signature verification module calls the pre-stored gateway public key, uses the extracted raw physical and spatiotemporal data string as the original message, and the extracted watermark feature code as the signature value, to execute an asymmetric signature verification algorithm (such as ECDSAverify). The signature verification output is a boolean value: True indicates a valid signature, and False indicates an invalid signature.

[0055] Result feedback: The signature verification module encapsulates the signature verification result (True / False) along with the terminal device's IP address, session ID, and other information into a JSON format message, and sends it to the gateway's monitoring port via a UDP or TCP connection.

[0056] Step S106: Trigger network blocking or continue the process based on the signature verification result.

[0057] The gateway's network blocking module continuously listens to the monitoring port and receives signature verification result messages from the target application server.

[0058] If a signature verification failure (False) result is received: the gateway determines that a hijacking attack has occurred. The network blocking module immediately performs the following operations: Destroy Socket: Use Netfilter's conntrack tool to find and forcibly destroy all conntrack entries (i.e., network connection tracking records) associated with the terminal device's IP address, which is equivalent to destroying all internal network communication sockets of the terminal.

[0059] Sending TCP RST messages: The gateway masquerades as the peer that the terminal device is communicating with (including exam servers, DNS servers, etc.) and sends a large number of TCP RST (reset) messages to the terminal device, forcibly closing all active TCP connections.

[0060] Add a DROP rule: Add a temporary rule to the FORWARD and INPUT chains of IPTables to drop all packets from this end device IP for 30 seconds.

[0061] The direct result of the above operation is that the browser on the terminal device instantly displays error messages such as "network connection interrupted" and "page failed to load", the streaming media player stops playing, the examination interface is forcibly locked, and the crew members cannot continue to answer questions or operate, thus achieving real-time, physical-level blocking.

[0062] If a signature verification result of True is received: the gateway will not perform any blocking operations, the video stream will continue to be transmitted normally, and the target application server will provide the video stream to the front-end page for normal business processes such as face recognition.

[0063] Step S107: Asynchronous audit packaging.

[0064] For watermarked video streams that have passed signature verification, the gateway's auditing and packaging module performs the following operations: At regular time intervals (e.g., every 5 minutes), the watermark feature codes, corresponding physical spatiotemporal data, verification results, timestamps, and other information of all video frames within that time period are concatenated into a data structure.

[0065] The data structure is encrypted using the public key of the shore-based server, generating an encrypted audit package.

[0066] The encrypted audit package is stored on the gateway's local solid-state drive, forming an audit log file.

[0067] When a vessel enters port or a satellite communication link becomes available, the gateway asynchronously uploads audit log files to the shore-based server via MQTT or HTTPS protocols. The shore-based server then decrypts the logs using its private key, enabling subsequent compliance audits and evidence tracing.

[0068] Detailed explanation of the dimensionality reduction fault tolerance mode: In step S102, if the multi-constellation GNSS chip fails to acquire a valid satellite signal for the following reasons: When ships enter high-latitude regions, satellite geometry is poor; The antenna is obstructed by snow, ice, or cargo; Encountering solar storms or electromagnetic interference; The gateway's physical spatiotemporal data acquisition module will then automatically trigger a dimensionality reduction fault-tolerance mode. The specific process is as follows: GNSS failure detection: The GNSS chip fails to output a valid GGA or RMC statement for 10 consecutive seconds, or the positioning accuracy factor (PDOP) is greater than 6.0.

[0069] Switching time source: The gateway immediately switches to the built-in high-precision temperature-compensated crystal oscillator (RTC) and reads the current UTC time. The RTC has been synchronously calibrated via PPS (pulse per second) signal when the GNSS is working normally, so its short-term accuracy is reliable.

[0070] Accessing the ship's bus: The gateway connects to the ship's NMEA2000 backbone network via the CAN interface to read the following data in real time: Heading data: from gyrocompass or magnetic compass, in degrees (°), with an accuracy of ±0.5°.

[0071] Speed ​​Over Ground (SOG) data: from a Doppler log or GPS simulator, in knots, with an accuracy of ±0.1 knots.

[0072] Dead Reckoning Algorithm: The gateway's dimensionality reduction and fault-tolerant unit executes the dead reckoning algorithm. Let the last valid GNSS positioning time be... The coordinates are ( , The current time is Time difference According to the current heading θ and speed v Calculate the displacement: Latitude change ( R (Earth's radius); Longitude change ; Current estimated coordinates: , ; Continuous monitoring: The gateway continuously monitors the GNSS signal recovery status. Once GNSS is relocked, it immediately exits the dimensionality reduction fault-tolerant mode, switches back to the actual GNSS coordinates, and recalibrates the RTC using GNSS time.

[0073] This fault-tolerance mechanism ensures that the watermark generation process will not be interrupted even in extreme situations where there is no satellite signal. The system can run continuously and stably for hours or even days, greatly enhancing the system's environmental adaptability.

[0074] Example 2 Reference Figure 2 This embodiment provides a local loopback audit system for preventing hijacking of streaming media based on a shipborne hardware gateway. The system is deployed in the local area network environment of an ocean-going vessel and includes a shipborne hardware gateway 100 and a target application server 200.

[0075] The shipboard hardware gateway 100 is deployed in the ship's IT room or bridge equipment room, serving as the core routing node of the ship's local area network. The gateway uses an industrial-grade embedded hardware platform (e.g., a NUC based on an ARM Cortex-A72 processor or x86 architecture) and runs a customized OpenWrt or Debian Linux system. Internally, it includes the following functional modules: Route redirection module 101: Implements DNS hijacking based on Dnsmasq and port redirection based on IPTables' DNAT and REDIRECT rules. The module maintains a hijacking rule table, recording the domain names and ports of the streaming media services to be hijacked. When target traffic is matched, redirection is automatically executed.

[0076] The physical spatiotemporal data acquisition module 102 integrates a u-blox ZED-F9P multi-constellation GNSS module (supporting GPS / BeiDou / GLONASS), a DS3231 high-precision RTC chip, and a CAN bus interface (for connecting to the NMEA2000 network). A daemon runs on the software, periodically (once per second) reading NMEA statements from the GNSS module and parsing information such as time, latitude and longitude, altitude, speed, and heading. Simultaneously, this module includes a dimensionality reduction fault-tolerant unit; when a GNSS failure is detected, it automatically executes the aforementioned dead reckoning algorithm, outputting estimated coordinates and time.

[0077] Asymmetric key storage module 103: Employs an ATECC608A or SLM9670 hardware security chip, with a pre-installed ECDSA P-256 public / private key pair for the gateway. The private key is permanently stored in the chip's secure storage area and cannot be read through the software interface. The public key can be exported via secure commands.

[0078] Watermark generation module 104: a software module that receives spatiotemporal data strings from physical spatiotemporal data acquisition module 102, calls the signature API of asymmetric key storage module 103, and generates a digital signature as a watermark feature code.

[0079] Watermark Embedding Module 105: A hardware acceleration module based on VPU. The VPU firmware pre-configures DCT transform and watermark embedding algorithms. The module receives the original H.264 video stream, watermark feature code, and original physical spatiotemporal data string, and embeds both into different DCT coefficient regions of the video frame in real time, outputting a watermarked H.264 video stream. The processing latency is controlled within 50ms.

[0080] Loopback Sending Module 106: A pipeline implementation based on GStreamer or FFmpeg. The module encapsulates the watermarked video stream into HLS fragments (.ts files and .m3u8 indexes) or WebRTC RTP packets, and sends them to the local address listened to by the target application server through the loopback interface.

[0081] Network blocking module 107: Implemented based on the Netfilter / IPTables and libnetfilter_queue libraries. The module maintains a blocking list and immediately performs the following actions upon receiving a signature verification failure message: The command `conntrack -D -s<terminal IP>` is invoked to destroy all related conntrack entries.

[0082] The libnet tool is used to send forged TCP RST packets, with the source IP masquerading as the target server and the destination IP being the terminal IP.

[0083] Add a -s<terminal IP>-j DROP rule to IPTables, which will block for 30 seconds and then be automatically removed.

[0084] Audit Packaging Module 108: Implemented using a lightweight database based on SQLite or LevelDB. The module periodically (every 5 minutes) writes the watermark hash digest, timestamp, verification result, and terminal device identifier of the verified signature to the local database. When the network recovers, the database records are encrypted and uploaded to the shore server via an MQTT client.

[0085] The target application server 200 is deployed on the terminal device (the PC used by the crew) and runs as a local Windows service or a Linux daemon. It contains the following modules: Public Key Storage Module 201: Upon initial deployment, the gateway's public key certificate is installed into the target application server's trust store via QR code scanning or USB import. The certificate uses the X.509 format and contains the gateway's public key and the shipowner CA's signature.

[0086] Watermark extraction module 202: Corresponding to the watermark embedding module 105 of the gateway, it performs inverse transform domain analysis. The module performs DCT transform on each frame of video image, extracts the watermark feature code from the first set of intermediate frequency coefficients, and extracts the original physical spatiotemporal data string from the second set of coefficients.

[0087] Signature verification module 203: Calls the OpenSSL or Mbed TLS encryption library, uses the extracted raw physical and spatiotemporal data string as the message, the extracted watermark feature code as the signature, and performs ECDSA signature verification using the public key in the public key storage module 201. The signature verification result (success / failure), along with terminal IP, timestamp, and other information, is sent to the gateway's monitoring port via UDP packets.

[0088] System workflow example: Suppose that crew member Zhang San is taking an online safety exam for ocean-going vessels on terminal device A.

[0089] Zhang San opened his browser and visited the exam system website: https: / / exam.ship.com / live.

[0090] The gateway's routing redirection module 101 detected the request and performed DNS hijacking, resolving exam.ship.com to the gateway IP address 192.168.1.1. The browser's WebRTC video stream request was then redirected to the gateway.

[0091] The gateway's physical spatiotemporal data acquisition module 102 obtains the current time as 2026-07-16 14:30:25 UTC, coordinates as 31°12.3456'N, 121°34.5678'E, and MAC address as 00:1A:2B:3C:4D:5E.

[0092] The watermark generation module 104 uses a private key to sign the above data and generates a 64-byte watermark feature code.

[0093] The watermark embedding module 105 embeds the watermark feature code into each frame of video image from the Zhang San camera, generating a watermarked video stream.

[0094] The loopback sending module 106 sends the watermarked video stream to the local examination server on terminal device A (listening at 127.0.0.1:8080) through the loopback interface.

[0095] The local exam server's watermark extraction module 202 extracts the watermark, and the signature verification module 203 verifies the signature using the public key; the signature verification is successful.

[0096] The signature verification result (True) is sent to the gateway, which does not block it, and the video stream is used normally for face recognition.

[0097] After the exam, the gateway's audit packaging module 108 uploads the encrypted audit package of this exam to the shore server.

[0098] Suppose another crew member, Li Si, attempts to cheat by installing the OBS virtual camera driver on his terminal device B and trying to play a pre-recorded video.

[0099] Li Si's browser also initiated a streaming media request, but the video stream was taken over by the gateway.

[0100] The gateway embeds a watermark and then loops back to send the data.

[0101] The local exam server extracted the watermark and verified the signature. The verification failed because Li Si's forged video stream lacked a valid private key signature.

[0102] The signature verification result (False) is sent to the gateway.

[0103] The gateway's network blocking module 107 immediately destroys all network connections of terminal device B and continuously sends TCP RST messages to it.

[0104] Li Si's browser immediately displayed "Network connection interrupted," the exam interface was forcibly locked, and the cheating behavior was blocked in real time.

[0105] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0106] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.

Claims

1. A local loopback auditing method for preventing streaming media hijacking based on a shipborne hardware gateway, characterized in that, Includes the following steps: Step S1: The shipborne hardware gateway intercepts the streaming media request initiated by the terminal device and performs route redirection within the local area network, forcibly routing the video stream corresponding to the streaming media request to the internal processing module of the shipborne hardware gateway. Step S2: The shipborne hardware gateway acquires the current physical spatiotemporal data and signs the physical spatiotemporal data using the asymmetric private key built into the shipborne hardware gateway to generate a digital watermark feature code. Step S3: The shipborne hardware gateway embeds the digital watermark feature code and the physical spatiotemporal data into the transform domain coefficients of each frame of the video stream to obtain a watermarked video stream. Step S4: The shipborne hardware gateway sends the watermarked video stream back to the target application server on the terminal device via the local area network loopback. Step S5: The target application server extracts the digital watermark feature code and the physical spatiotemporal data from the received watermarked video stream, and uses the pre-stored public key of the shipborne hardware gateway to verify the signature with the physical spatiotemporal data as the message and the digital watermark feature code as the signature, and sends the verification result to the shipborne hardware gateway. In step S6, after receiving the signature verification failure result, the shipborne hardware gateway determines that a hijacking attack has occurred, triggers a network layer physical channel blocking operation, and forcibly interrupts the network connection of the terminal device.

2. The method according to claim 1, characterized in that, The physical spatiotemporal data mentioned in step S2 includes at least: the current absolute time, geographical location coordinates, and the hardware identifier of the shipborne hardware gateway.

3. The method according to claim 2, characterized in that, The geographical coordinates are obtained through a multi-constellation global navigation satellite system (GNSS) chip, which simultaneously supports GPS, BeiDou, and GLONASS signal reception.

4. The method according to claim 3, characterized in that, When the multi-constellation GNSS chip fails to acquire valid satellite signals, the shipborne hardware gateway automatically switches to a fault-tolerant mode. The current time is obtained by reading the high-precision temperature-compensated crystal oscillator real-time clock (RTC) built into the shipborne hardware gateway. Real-time acquisition of heading beacon data and log speed data from the ship's backbone network NMEA2000 bus; The current geographic coordinates are dynamically estimated using dead reckoning and used as replacement values ​​for the geographic coordinates.

5. The method according to claim 1, characterized in that, The transform domain coefficients mentioned in step S3 are the intermediate frequency coefficients of the Discrete Cosine Transform (DCT).

6. The method according to claim 1, characterized in that, The network layer physical channel blocking operation described in step S6 specifically includes: The firewall kernel of the shipborne hardware gateway destroys all internal network communication sockets of the terminal device; and / or The shipborne hardware gateway continuously sends hardware-level TCP reset messages to the terminal device to forcibly disconnect the network connection.

7. The method according to claim 1, characterized in that, It also includes step S7: For watermarked video streams that have passed verification, the shipborne hardware gateway packages its watermark hash digest into an encrypted audit package, which is then asynchronously uploaded to the shore-based server after the network is restored.

8. A local loopback auditing system for preventing hijacking of streaming media based on a shipborne hardware gateway, characterized in that, It includes a shipborne hardware gateway and a target application server; the shipborne hardware gateway is deployed in the ship's local area network as a routing control node; The target application server is deployed on the terminal device; wherein... The shipborne hardware gateway includes: The routing redirection module is used to intercept streaming media requests initiated by terminal devices and force the corresponding video stream to be routed to the internal processing module. The physical spatiotemporal data acquisition module is used to acquire current physical spatiotemporal data; An asymmetric key storage module is used to store the asymmetric private key and public key of the shipborne hardware gateway; The watermark generation module is used to sign the physical spatiotemporal data using the asymmetric private key and generate a digital watermark feature code. The watermark embedding module is used to embed the digital watermark feature code and the physical spatiotemporal data into the transform domain coefficients of each frame of the video stream to obtain a watermarked video stream. The loopback transmission module is used to loopback the watermarked video stream to the target application server on the terminal device via a local area network. The network blocking module is used to trigger a network layer physical channel blocking operation when a signature verification failure signal is received, thereby forcibly interrupting the network connection of the terminal device. The target application server includes: A public key storage module is used to pre-acquire and store the public key of the shipborne hardware gateway; The watermark extraction module is used to extract the digital watermark feature code and the physical spatiotemporal data from the received watermarked video stream. The signature verification module is used to verify the signature using the pre-stored public key of the shipborne hardware gateway, with the physical spatiotemporal data as the message and the digital watermark feature code as the signature, and then sends the signature verification result to the network blocking module of the shipborne hardware gateway.

9. The system according to claim 8, characterized in that, The network blocking module is specifically used to: destroy all internal network communication sockets of the terminal device through the firewall kernel, and / or continuously send hardware-level TCP reset messages to the terminal device.

10. The system according to claim 8, characterized in that, The shipborne hardware gateway also includes an audit packaging module, which is used to encrypt and package the watermark hash digest of the watermarked video stream that has passed the verification, generate an encrypted audit package, and asynchronously upload it to the shore-based server after the network is restored.