Analog video encryption and decryption method and system
By employing encryption and decryption methods involving analog-to-digital conversion, pixel repositioning, and digital-to-analog conversion of analog video signals, the problem of insufficient encryption strength in existing analog video transmission systems has been solved, enabling high-strength secure transmission of video information.
Patent Information
- Application Number
- CN202511085990.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-05
- Publication Date
- 2025-11-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing analog video transmission encryption methods have low encryption strength and are unable to meet the growing security requirements. Especially in application scenarios with high information security requirements, such as drones, the illegal acquisition of video information may have serious consequences.
After the original analog video signal is converted from analog to digital, the encrypted digital video signal is generated by rearranging the pixel positions and then converted from digital to analog, destroying the spatial correlation of the video image; during decryption, the reverse rearrangement process is performed to restore the original video signal.
It enhances the encryption strength of analog video, ensuring the confidentiality and integrity of video information during transmission and providing reliable security support.
Smart Images

Figure CN120897033A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video image processing technology, and in particular to an analog video encryption and decryption method and system. Background Technology
[0002] In today's era of rapid technological advancement, drones, with their flexibility and convenience, have been widely applied in numerous fields, such as agricultural monitoring, logistics delivery, and security surveillance. With the widespread adoption of drones, the market demand for low-cost drones is becoming increasingly strong. Analog image transmission, due to its significant advantages of low price and low latency, occupies an important position in the low-cost drone market. Through analog image transmission technology, drones can transmit captured video footage to a ground receiver in real time, providing users with intuitive visual information.
[0003] However, with the large-scale application of analog video transmission in the drone field, its inherent shortcomings have gradually become apparent, among which the information security of analog video content is particularly prominent. Existing analog video encryption methods have significant deficiencies, with low encryption strength, making it difficult to meet the growing security demands. Traditional encryption methods typically process only the analog video signal level. While this method prevents others from correctly viewing encrypted video without a decryption module, all users equipped with the same decryption module can correctly decrypt the video, rendering the encryption measures meaningless and unable to achieve high-strength, high-security encrypted transmission.
[0004] In applications with high information security requirements, such as military applications, classified surveillance, and monitoring of critical facilities, the unauthorized acquisition of analog video transmission information could lead to serious consequences. Therefore, effectively enhancing the encryption security of analog video transmission and ensuring the confidentiality and integrity of video information during transmission has become a critical issue that urgently needs to be addressed in the field of unmanned aerial vehicles (UAVs). Summary of the Invention
[0005] In view of the above, in order to at least partially address the shortcomings of the prior art, in a first aspect, embodiments of this application provide a simulated video encryption / decryption method, the method comprising:
[0006] The original analog video signal is subjected to analog-to-digital conversion to obtain the original digital video signal. The original digital video signal contains multiple video frame units arranged in a time sequence, and each video frame unit is composed of multiple pixel data units.
[0007] The original digital video signal is subjected to pixel position rearrangement processing to generate an encrypted digital video signal. The pixel position rearrangement processing includes swapping the positions of pixels in each pixel unit based on a preset mapping rule.
[0008] The encrypted digital video signal is subjected to digital-to-analog conversion to obtain an encrypted analog video signal;
[0009] The encrypted analog video signal is subjected to analog-to-digital conversion to obtain the digital video signal to be decrypted;
[0010] The pixel position inverse rearrangement process is performed on the digital video signal to be decrypted to generate the original digital video signal. The pixel position inverse rearrangement process includes performing a position recovery operation on the pixels in each pixel unit based on a preset inverse mapping rule, and performing digital-to-analog conversion processing on the recovered original digital video signal to output the original analog video signal.
[0011] Secondly, embodiments of this application also provide an analog video encryption / decryption system, including a processor and a machine-readable storage medium connected to the processor. The machine-readable storage medium is used to store programs, instructions, or code, and the processor is used to execute the programs, instructions, or code in the machine-readable storage medium to implement the analog video encryption / decryption method.
[0012] Thirdly, embodiments of this application also provide a computer-readable storage medium, characterized in that it is used to store programs, instructions or code, which, when executed by a processor, implement the analog video encryption / decryption method.
[0013] In summary, the analog video encryption and decryption method and system provided in this application, by performing analog-to-digital conversion on the original analog video signal in the digital domain and then rearranging the pixel positions, destroys the spatial correlation of pixels in the video image, making it difficult for the human eye to extract useful information from the encrypted video, thus effectively improving the encryption strength of analog video. Furthermore, through a complete encryption and decryption process, including analog-to-digital conversion, pixel position rearrangement, digital-to-analog conversion, and inverse rearrangement, the original analog video signal can be accurately recovered, ensuring the integrity and accuracy of the video information and providing reliable technical support for the secure application of analog image transmission in fields such as drones.
[0014] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the above drawings without creative effort.
[0016] To gain a more complete understanding of this application and its beneficial effects, the following description will be provided in conjunction with the accompanying drawings, wherein the same reference numerals in the following description denote the same parts.
[0017] Figure 1 This is the intended application scenario for the simulated video encryption / decryption method provided in the embodiments of this application.
[0018] Figure 2 This is a flowchart illustrating a simulated video encryption / decryption method provided in an embodiment of this application.
[0019] Figure 3 This is a schematic diagram of an analog video encryption / decryption system provided in an embodiment of this application. Detailed Implementation
[0020] 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 a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the protection scope of this application.
[0021] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of the simulated video encryption / decryption method provided in this embodiment. In this embodiment, the application scenario includes a drone engaging in communication and multiple video processing terminals. In this embodiment, the simulated video encryption / decryption method can be implemented by the video processing terminals. The video processing terminals can be devices with big data processing and storage capabilities, such as laptops, smartphones, tablets, servers, or server clusters. They can also be devices with data acquisition and transmission capabilities, such as portable video processing terminal computers. This embodiment does not specifically limit the type of terminal.
[0022] In this embodiment, during the drone's mission, its camera continuously captures images of the surrounding environment, generating raw analog video signals. The drone then transmits these raw analog video signals wirelessly to a video processing terminal via an analog image transmission module. Upon receiving the raw analog video signal, the video processing terminal initiates an analog video encryption / decryption method. The drone can be, but is not limited to, consumer-grade drones or industrial-grade drones. Consumer-grade drones can be used for aerial photography, entertainment, and other scenarios, capturing beautiful scenery and recording life for users; industrial-grade drones can be used for agricultural plant protection, power line inspection, logistics transportation, etc., helping to improve production efficiency and reduce labor costs.
[0023] like Figure 2As shown, the method includes steps S110-S150, which will be described in detail below.
[0024] Step S110: Perform analog-to-digital conversion on the original analog video signal to obtain the original digital video signal. The original digital video signal contains multiple video frame units arranged in time sequence, and each video frame unit consists of multiple pixel data units.
[0025] In this embodiment, the original analog video signal can be provided by the drone via analog image transmission, which transmits the footage captured by the drone in analog signal form. After receiving the original analog video signal, the analog-to-digital conversion module processes it, converting the continuous analog signal into a discrete digital signal. During this process, the original analog video signal is divided into multiple video frame units arranged in a time sequence, with each video frame unit representing a specific moment in the frame. Each video frame unit consists of multiple pixel data units, which record the pixel information of the frame in different rows. Each pixel unit can be a row of pixels or a column of pixels; this embodiment does not limit this.
[0026] Step S120: Perform pixel position rearrangement processing on the original digital video signal to generate an encrypted digital video signal.
[0027] As an example, the pixel position rearrangement process can include a row-based rearrangement method and a column-based rearrangement method. It can include swapping the positions of pixels in each pixel unit based on a preset mapping rule. The pixel unit can be a row pixel unit or a column pixel unit. Each row pixel unit includes multiple pixels located in one row, and each column pixel unit includes multiple pixels located in one column. For example, in the row-based method, starting from the first row of the video frame (assuming a row has multiple pixels such as P1, P2, P3, etc.), a temporary storage area is allocated for the current row pixel data unit. Then, each pixel in the current row is traversed, and the pixel value is written to the corresponding position in the temporary storage area according to the mapping table. For example, if P1 corresponds to the 3rd position, its pixel value is written to that position. After traversing all pixels in the current row, the pixel values are read according to the storage order in the temporary storage area to obtain the rearranged current row pixel data unit. This operation is repeated for each row of the video frame. The rearranged rows are combined sequentially to form the encrypted digital video frame unit of the video frame. All video frames are processed sequentially and spliced together according to the time sequence to obtain the encrypted digital video signal. When using columns as units, we can start from the first column of the video frame (assuming the first column of pixels includes C1, C2, C3, etc.). We allocate a temporary storage area for the pixel data unit of the current column, traverse each pixel of the current column, and write the pixel value to the corresponding position in the temporary storage area according to the mapping table. For example, if C1 corresponds to the 4th position, we write it to that position. After traversing all pixels of the current column, we read the pixel values according to the storage order of the temporary storage area to obtain the rearranged pixel data unit of the current column. We repeat this operation for each column of the video frame, combine the rearranged columns to form an encrypted digital video frame unit, process all video frames in sequence, and splice them together to obtain the encrypted digital video signal.
[0028] In this embodiment, as one possible approach, the specific implementation method is described in detail below in conjunction with the row-by-row rearrangement processing method. Based on this approach, S120 may include the following sub-steps S121-S1210, which are described in detail below.
[0029] Step S121: Obtain the random number set by the user. This random number is used to determine the index information of the pixel position mapping rule. In practical applications, the user can set a random number according to their own needs. This random number will serve as key information for subsequent lookup of pixel position mapping rules. For example, the random number can be a specific code that corresponds to different pixel position mapping tables.
[0030] Step S122: Retrieve the corresponding pixel position mapping table from the storage unit based on the random number. The pixel position mapping table contains the target position index of each pixel in each row of pixel data units of each video frame unit in the original digital video signal.
[0031] The storage unit primarily stores pixel position mapping tables, which contain the target position index of each pixel in each row of pixel data units within each video frame unit of the original digital video signal. The video processing terminal communicates with the drone, receiving the raw analog video signal sent by the drone and encrypting / decrypting it. When the video processing terminal performs pixel position rearrangement, it retrieves the corresponding pixel position mapping table from the storage unit based on a user-defined random number. The video processing terminal locates the corresponding pixel position mapping table in the storage unit using the random number. Once found, it loads the mapping table into its processing buffer for subsequent pixel position swapping operations on the original digital video signal to generate an encrypted digital video signal. During decryption, the video processing terminal also retrieves the corresponding pixel position mapping table from the storage unit using the same random number set by the user as during encryption, and further generates an inverse pixel position mapping table. This inverse mapping table is used to perform inverse pixel position rearrangement on the encrypted digital video signal to recover the original digital video signal.
[0032] The storage unit provides the data support for the video processing terminal to perform analog video encryption and decryption operations. By providing a pixel position mapping table, it ensures that the video processing terminal can accurately encrypt and decrypt video signals, thus guaranteeing the secure transmission and use of analog video information.
[0033] In this embodiment, S122 may include the following sub-steps S1221-S1225, which will be described in detail below.
[0034] Step S1221: Verify the random number to check if it meets the preset numerical range requirement. The numerical range requirement is the index range of the pixel position mapping table pre-stored in the storage unit. The storage unit pre-stores a large number of pixel position mapping tables, each with a corresponding index range. Before retrieving the mapping table, the user-set random number needs to be verified to ensure it is within the preset index range. If the random number exceeds this range, it indicates that the random number is invalid and the corresponding mapping table may not be found.
[0035] Step S1222: When the verification passes, read the mapping table metadata associated with the random number from the storage unit. The mapping table metadata includes the total number of rows in the pixel position mapping table, the number of pixels per row, and a data checksum. Once the random number verification passes, the mapping table metadata associated with that random number can be read from the storage unit. This metadata contains basic information about the pixel position mapping table, such as the total number of rows, the number of pixels per row, and the data checksum. The total number of rows indicates how many rows of data the mapping table contains, the number of pixels per row indicates how many pixels are in each row, and the data checksum is used for subsequent data consistency verification.
[0036] Step S1223: Perform an integrity check on the pixel location mapping table based on the total number of rows and the number of pixels per row to ensure that the mapping table contains all the target location indices of each row of pixel data units for each video frame unit.
[0037] Based on the total number of rows and the number of pixels per row, an integrity check can be performed on the pixel location mapping table. The purpose of the check is to ensure that the mapping table contains the target location index of each pixel in each row of pixel data units of each video frame unit, and that no pixel location information is missing.
[0038] Step S1224: Perform data consistency verification on the pixel position mapping table using the data verification code to ensure that the retrieved pixel position mapping table has not been corrupted or tampered with.
[0039] The pixel position mapping table can be validated for data consistency using a data checksum in its metadata. This checksum is generated during the storage of the mapping table and is used to verify data integrity and consistency. By validating the retrieved mapping table, it can be ensured that no data corruption or tampering has occurred during storage and retrieval.
[0040] Step S1225: When both the integrity check and data consistency check pass, the pixel position mapping table is loaded into the processing buffer for subsequent row pixel data unit position mapping operations.
[0041] If the pixel location mapping table passes the integrity check and data consistency check, it is considered valid and can be loaded into the processing buffer. The processing buffer is used to temporarily store the mapping table so that it can be quickly accessed when performing location mapping operations on row pixel data units later.
[0042] Step S123: Extract the frame header information of the current frame from the original digital video signal. The frame header information indicates the total number of rows in the current frame and the start position identifier of each row of pixel data units. When processing the original digital video signal, it is necessary to extract the frame header information of the current frame. The frame header information contains important parameters of the current frame, such as the total number of rows and the start position identifier of each row of pixel data units. The total number of rows indicates how many rows of pixel data units the current frame has, while the start position identifier is used to locate the start position of each row of pixel data units.
[0043] Step S124: Locate the first row of pixel data units in the current frame based on the frame header information, and perform row count initialization processing on the first row of pixel data units, setting the row count parameter to the initial value.
[0044] In this embodiment, the first row of pixel data units in the current frame can be located based on the extracted frame header information. Simultaneously, to facilitate subsequent processing of each row of pixel data units, the row count parameter needs to be initialized, setting it to an initial value, typically 1, indicating that processing begins from the first row.
[0045] Step S125: Find the target position index corresponding to each pixel in the current row of pixel data units from the pixel position mapping table. The target position index is the position identifier of the current pixel in the rearranged row of pixel data units.
[0046] In this embodiment, after determining the pixel data unit of the current row, it is necessary to look up the target position index corresponding to each pixel in the current row from the pixel position mapping table loaded into the processing buffer. The target position index represents the new position of the pixel in the rearranged pixel data unit.
[0047] Step S126: Perform a position swap operation on the pixels in the current row pixel data unit according to the target position index to generate rearranged row pixel data units. The position swap operation is to move the current pixel from its original position to the position indicated by the target position index.
[0048] In this embodiment, S126 may include the following sub-steps S1261-S1266, which will be described in detail below.
[0049] Step S1261: Allocate a temporary storage buffer for the current row pixel data unit. The capacity of the temporary storage buffer is the same as the number of pixels in the current row pixel data unit.
[0050] Before performing pixel position swapping, a temporary storage buffer needs to be allocated for the current row of pixel data units. The capacity of this buffer should be the same as the number of pixels in the current row of pixel data units to ensure that information for all pixels can be stored.
[0051] Step S1262: Traverse each pixel in the current row of pixel data units, and read the original position identifier and corresponding pixel value of each pixel in turn.
[0052] By iterating through each pixel in the current row of pixel data units, the original position identifier and corresponding pixel value of each pixel can be read sequentially. The original position identifier indicates the initial position of the pixel in the current row, while the pixel value represents information such as the pixel's color or brightness.
[0053] Step S1263: For each pixel, look up the corresponding target position index from the pixel position mapping table based on its original position identifier.
[0054] Based on the original location identifier of each pixel, its corresponding target location index can be looked up from the pixel location map table. This target location index will determine the new position of the pixel in the rearranged row of pixel data units.
[0055] Step S1264: Write the read pixel value to the storage address indicated by the target location index in the temporary storage buffer.
[0056] After finding the target location index for each pixel, the read pixel value is written to the storage address indicated by the target location index in the temporary storage buffer, so that the pixel is moved to the new location.
[0057] Step S1265: After the traversal is completed, all pixel values in the temporary storage buffer are read in order of storage address and rearranged into pixel data units for the next row.
[0058] After traversing all pixels in the current row and writing the corresponding pixel values to the temporary storage buffer, all pixel values in the temporary storage buffer are read in the order of storage address to form the rearranged pixel data unit.
[0059] Step S1266: Release the temporary storage buffer area and complete the position swapping operation of the current row pixel data unit.
[0060] After the rearranged row of pixel data units is formed, the temporary storage buffer is released to allow for the subsequent processing of pixel data units in other rows.
[0061] Step S127: Determine whether the current row pixel data unit is the last row pixel data unit of the current frame.
[0062] After completing the position swapping operation of the current row of pixel data units, it is necessary to determine whether the current row is the last row of the current frame. For example, the determination can be based on whether the current row count parameter is equal to the total number of rows indicated in the frame header information. If the current row count parameter is equal to the total number of rows, it means that the current row is the last row; otherwise, it is necessary to continue processing the next row.
[0063] Step S128: If the judgment result is negative, increment the row count parameter and return to the step of finding the target position index corresponding to each pixel in the current row of pixel data units from the pixel position mapping table, and continue processing the next row of pixel data units. If the current row is not the last row, increment the row count parameter by 1. Then return to step S125 to continue finding the target position index corresponding to each pixel in the next row of pixel data units from the pixel position mapping table, and perform a position swap operation on the next row.
[0064] Step S129: When the judgment result is yes, combine all rearranged row pixel data units in the current frame into encrypted digital video frame units in the current frame in row order.
[0065] If the current row is the last row of the current frame, it means that the position swapping operation of all row pixel data units in this frame has been completed. At this time, combining all the rearranged row pixel data units in the current frame in row order will yield the encrypted digital video frame unit of the current frame.
[0066] Step S1210: The encrypted digital video frame units are spliced together according to the time sequence to generate an encrypted digital video signal, and the time sequence is consistent with the time sequence of the video frame units in the original digital video signal.
[0067] In this embodiment, S1210 may include the following sub-steps S12101-S12105, which will be described in detail below.
[0068] Step S12101: Allocate a sequence storage buffer for the encrypted digital video signal. The capacity of the sequence storage buffer is determined based on the total number of frames of the original digital video signal and the amount of data per frame.
[0069] Before splicing the encrypted digital video signal, a sequence storage buffer needs to be allocated to it. The capacity of the sequence storage buffer should be determined based on the total number of frames of the original digital video signal and the amount of data per frame to ensure that all encrypted digital video frame units can be stored.
[0070] Step S12102: Starting from the first encrypted digital video frame unit, write each encrypted digital video frame unit into the sequence storage buffer in time stamp order.
[0071] Based on the time sequence of video frame units in the original digital video signal, starting from the first encrypted digital video frame unit, each encrypted digital video frame unit is written into the sequence storage buffer in the order of timestamp.
[0072] Step S12103: During the writing process, the continuity of the frame header information of adjacent encrypted digital video frame units is checked to ensure that the timestamp order is correct and no frames are lost.
[0073] During the writing of encrypted digital video frame units, the continuity of the frame header information of adjacent frames needs to be verified. The purpose of this verification is to ensure that the timestamp order is correct and that no frames are missing. If discontinuous timestamps between adjacent frames or missing frames are found, it indicates that there may have been a problem with the data processing, and appropriate action needs to be taken.
[0074] Step S12104: After all encrypted digital video frame units have been written, perform an overall verification of the data in the sequence storage buffer, calculate the checksum of the data and compare it with the preset check value.
[0075] After all encrypted digital video frame units have been written to the sequence storage buffer, the data needs to be verified as a whole. By calculating the checksum of the data and comparing it with a preset check value, the integrity and accuracy of the data can be verified.
[0076] Step S12105: When the verification passes, the data in the sequence storage buffer is output as an encrypted digital video signal to complete the splicing operation.
[0077] If the data verification passes, it means that the data in the sequence storage buffer is complete and accurate, and it can be output as an encrypted digital video signal to complete the splicing operation of the encrypted digital video signal.
[0078] Furthermore, based on the above implementation method, step S120 performs pixel position rearrangement processing on the original digital video signal to generate an encrypted digital video signal. In addition to the common row-based and column-based methods, an implementation method based on a specific geometric region (or a preset geometric region) can also be adopted.
[0079] For example, when rearranging pixel positions based on specific geometric regions, each video frame of the original digital video signal is first divided into multiple specific geometric regions, such as triangles, squares, and hexagons, making the pixel position rearrangement more random and complex. After the user sets a random number, the video processing terminal retrieves the corresponding pixel position mapping table based on the geometric region from the storage unit. This mapping table records the target position index of pixels within each geometric region in detail. For example, for pixels within a triangular region, the mapping table explicitly indicates the new position of each pixel after rearrangement. The video processing terminal starts processing from the first geometric region of the video frame, allocating a temporary storage area for that region, traversing each pixel within the region, and writing the pixel value to the corresponding position in the temporary storage area according to the mapping table. After traversal, the pixel values are read in storage order to obtain the pixel data unit of the rearranged geometric region. Then, the same operation is performed sequentially on each other geometric region of the video frame. Finally, all rearranged geometric regions are combined to form an encrypted digital video frame unit, and the video frames are then spliced together in time sequence to form an encrypted digital video signal.
[0080] Thus, this implementation method, based on specific geometric regions, significantly enhances encryption security. Because the division of geometric regions and the rearrangement of pixels are more complex and random, it becomes more difficult for attackers to analyze and crack the encryption rules, effectively disrupting the spatial correlation of pixels in the video image and making it harder for the human eye to extract useful information from the encrypted video. Secondly, it increases the flexibility of encryption. Different random numbers can correspond to different geometric region division methods and pixel position mapping tables, making the encryption method more diverse and meeting the information security needs of different users and application scenarios. Finally, this method can, to some extent, reduce the regularity that may appear due to fixed row or column rearrangements, further improving the concealment of the encryption.
[0081] Step S130: Perform digital-to-analog conversion on the encrypted digital video signal to obtain an encrypted analog video signal.
[0082] After pixel repositioning and splicing of the encrypted digital video signal, the encrypted digital video signal needs to undergo digital-to-analog conversion. The digital-to-analog conversion module converts the discrete encrypted digital video signal into a continuous analog signal, resulting in an encrypted analog video signal. This encrypted analog video signal can be transmitted via analog video transmission. Because its pixel positions have been rearranged, the human eye cannot directly obtain useful information from it, thus improving the security of the video information.
[0083] Step S140: Perform analog-to-digital conversion on the encrypted analog video signal to obtain the digital video signal to be decrypted. The digital video signal to be decrypted has the same video frame unit structure and row pixel data unit composition as the encrypted digital video signal.
[0084] Upon receiving an encrypted analog video signal, it needs to undergo analog-to-digital conversion (ADC). The ADC module converts the continuous encrypted analog video signal into discrete digital signals, resulting in the digital video signal to be decrypted. The digital video signal to be decrypted has the same video frame unit structure and row pixel data unit composition as the encrypted digital video signal; however, its pixel positions are still rearranged, requiring a reverse rearrangement operation to recover the original video.
[0085] Step S150: Perform pixel position inverse rearrangement processing on the digital video signal to be decrypted to generate the original digital video signal. The pixel position inverse rearrangement processing includes performing position recovery operation on the pixels in each pixel unit based on a preset inverse mapping rule, and performing digital-to-analog conversion processing on the recovered original digital video signal to output the original analog video signal.
[0086] In this embodiment, S150 may include the following sub-steps S151-S1511, which will be described in detail below.
[0087] Step S151: Obtain the random number set by the user. The random number should be consistent with the random number used in the encryption process.
[0088] Before performing the pixel position reordering process, a user-defined random number needs to be obtained, and this random number must be consistent with the random number used in the encryption process. Only by using the same random number can the correct inverse mapping rule be found to restore the pixel position to its original state.
[0089] Step S152: Retrieve the corresponding pixel position mapping table from the storage unit based on the random number, and generate a pixel position inverse mapping table based on the pixel position mapping table. The pixel position inverse mapping table contains the original position index of each pixel in each row of pixel data units of each video frame unit in the digital video signal to be decrypted.
[0090] In this embodiment, S152 may include the following sub-steps S1521-S1525, which will be described in detail below.
[0091] Step S1521: Traverse the target position index set corresponding to each row of pixel data units in each video frame unit of the pixel position mapping table. First, it is necessary to traverse the target position index set corresponding to each row of pixel data units in each video frame unit of the pixel position mapping table. By traversing this set, the target position information for each pixel can be obtained.
[0092] Step S1522: For the target position index set of each row of pixel data units, construct a mapping relationship between the original position identifier and the target position index, where the original position identifier is the position of the pixel in the original row of pixel data units, and the target position index is the position of the pixel in the rearranged row of pixel data units.
[0093] For each row of pixel data units, a mapping relationship needs to be constructed between the original position identifier and the target position index. The original position identifier represents the pixel's position in the original row of pixel data units, and the target position index represents the pixel's position in the rearranged row of pixel data units. By constructing this mapping relationship, the positional changes of each pixel can be clearly understood.
[0094] Step S1523: Reverse the mapping pairs, using the target location index as the key and the original location identifier as the value, to generate a set of reverse mapping pairs.
[0095] After constructing the mapping pairs, they need to be reversed. Using the target location index as the key and the original location identifier as the value, a set of inverse mapping pairs is generated. This set of inverse mapping pairs is used for subsequent pixel position recovery operations.
[0096] Step S1524: Store the inverse mapping relationship set row by row to form a pixel position inverse mapping table. The structure of the pixel position inverse mapping table is consistent with the structure of the pixel position mapping table, containing the same total number of rows and the number of pixels per row.
[0097] By storing the generated inverse mapping relationships row by row in the set, a pixel position inverse mapping table can be formed. The structure of the pixel position inverse mapping table is consistent with that of the pixel position mapping table, containing the same total number of rows and the number of pixels per row, which facilitates subsequent lookup and use.
[0098] Step S1525: Verify the generated pixel position inverse mapping table by randomly selecting multiple mapping pairs from the pixel position mapping table and performing a reverse lookup through the pixel position inverse mapping table to verify whether the original position identifier obtained by the reverse lookup is consistent with the original position identifier in the selected mapping pair.
[0099] To ensure the accuracy of the pixel location inverse mapping table, it needs to be verified. Multiple mapping pairs are randomly selected from the pixel location mapping table, and then a reverse lookup is performed using the pixel location inverse mapping table to check if the original position identifier obtained from the reverse lookup matches the original position identifier in the selected mapping pairs. If they match, the pixel location inverse mapping table is accurate; if they do not match, the inverse mapping table needs to be checked and corrected.
[0100] Step S153: Extract the frame header information of the current frame from the digital video signal to be decrypted. The frame header information is used to indicate the total number of rows in the current frame and the starting position identifier of each row of pixel data units.
[0101] When performing pixel position reversal processing on the digital video signal to be decrypted, it is necessary to extract the frame header information of the current frame. The frame header information contains important parameters of the current frame, such as the total number of rows and the starting position identifier of each row of pixel data units. This information is used to locate and process each row of pixel data units.
[0102] Step S154: Locate the first row of pixel data units in the current frame based on the frame header information, and perform row count initialization processing on the first row of pixel data units, setting the row count parameter to the initial value.
[0103] Based on the extracted frame header information, the first row of pixel data units in the current frame can be located. Simultaneously, to facilitate subsequent processing of each row of pixel data units, the row count parameter needs to be initialized, setting it to an initial value, typically 1, indicating that processing begins from the first row.
[0104] Step S155: Find the original position index of each pixel in the current row of pixel data units from the inverse pixel position mapping table. The original position index is the position identifier of the current pixel in the original row of pixel data units. After determining the current row of pixel data units, it is necessary to find the original position index of each pixel in the current row from the inverse pixel position mapping table. The original position index represents the position of the pixel in the original row of pixel data units, and the pixel can be restored to its original position using this index.
[0105] Step S156: Perform a position recovery operation on the pixels in the current row pixel data unit according to the original position index to generate the recovered row pixel data unit. The position recovery operation is to move the current pixel from the encrypted position to the position indicated by the original position index.
[0106] In this embodiment, S156 may include the following sub-steps S1561-S1566, which will be described in detail below.
[0107] Step S1561: Allocate a temporary storage buffer for the current row pixel data unit. The capacity of the temporary storage buffer is the same as the number of pixels in the current row pixel data unit.
[0108] Before performing pixel position recovery, a temporary storage buffer needs to be allocated for the current row of pixel data units. The capacity of this buffer should be the same as the number of pixels in the current row of pixel data units to ensure that information for all pixels can be stored.
[0109] Step S1562: Traverse each pixel in the current row of pixel data units, and read the encrypted position identifier and corresponding pixel value of each pixel in turn.
[0110] By traversing each pixel in the current row of pixel data units, the encrypted position identifier and corresponding pixel value of each pixel can be read sequentially. The encrypted position identifier indicates the position of the pixel in the encrypted row of pixel data units, while the pixel value represents information such as the pixel's color or brightness.
[0111] Step S1563: For each pixel, look up the corresponding original position index from the pixel position inverse mapping table based on its encrypted position identifier.
[0112] Based on the encrypted location identifier of each pixel, its corresponding original location index can be looked up from the pixel location inverse mapping table. This original location index will determine the position of the pixel in the recovered row of pixel data units.
[0113] Step S1564: Write the read pixel value to the storage address indicated by the original position index in the temporary storage buffer. After finding the original position index of each pixel, write the read pixel value to the storage address indicated by that original position index in the temporary storage buffer. In this way, the pixel is moved to its original position.
[0114] Step S1565: After the traversal is completed, all pixel values in the temporary storage buffer are read in order of storage address to form the restored row pixel data unit.
[0115] After traversing all pixels in the current row and writing the corresponding pixel values to the temporary storage buffer, all pixel values in the temporary storage buffer are read in the order of storage address to form the pixel data unit for the restored row.
[0116] Step S1566: Release the temporary storage buffer area and complete the position recovery operation of the current row pixel data unit.
[0117] After the recovered row pixel data unit is formed, the temporary storage buffer is released to allow for the subsequent processing of pixel data units of other rows.
[0118] Step S157: Determine whether the current row pixel data unit is the last row pixel data unit of the current frame.
[0119] After restoring the position of the current row of pixel data units, it is necessary to determine whether the current row is the last row of the current frame. For example, this can be determined by whether the current row count parameter is equal to the total number of rows indicated in the frame header information. If the current row count parameter is equal to the total number of rows, it means that the current row is the last row; otherwise, it is necessary to continue processing the next row.
[0120] Step S158: When the judgment result is negative, increment the row count parameter and return to the step of finding the original position index corresponding to each pixel in the current row of pixel data units from the reverse pixel position mapping table, and continue to process the next row of pixel data units.
[0121] If the current row is not the last row, the row count parameter needs to be incremented by 1. Then return to step S155 to continue searching for the original position index corresponding to each pixel in the next row of pixel data units from the pixel position reverse mapping table, and perform position recovery operation on the next row.
[0122] Step S159: When the judgment result is yes, combine all the recovered row pixel data units in the current frame in row order to form the original digital video frame unit of the current frame.
[0123] If the current row is the last row of the current frame, it means that the position restoration operation of all row pixel data units in the frame has been completed. At this time, combining all the restored row pixel data units in the current frame in row order will give us the original digital video frame unit of the current frame.
[0124] Step S1510: The original digital video frame units are spliced together according to the time sequence to generate the original digital video signal, and the time sequence is consistent with the time sequence of the video frame units in the digital video signal to be decrypted. In this embodiment, S1510 may include the following sub-steps S15101-S15105, which will be described in detail below.
[0125] Step S15101: Allocate a sequence storage buffer for the original digital video signal. The capacity of the sequence storage buffer is determined based on the total number of frames of the digital video signal to be decrypted and the amount of data per frame.
[0126] Before splicing the original digital video signal, a sequence storage buffer needs to be allocated to it. The capacity of the sequence storage buffer should be determined based on the total number of frames of the digital video signal to be decrypted and the amount of data in each frame, to ensure that all original digital video frame units can be stored.
[0127] Step S15102: Starting from the first raw digital video frame unit, write each raw digital video frame unit into the sequence storage buffer in time stamp order.
[0128] According to the time sequence of video frame units in the digital video signal to be decrypted, starting from the first original digital video frame unit, each original digital video frame unit is written into the sequence storage buffer in the order of timestamp.
[0129] Step S15103: During the writing process, the continuity of the frame header information of adjacent original digital video frame units is checked to ensure that the timestamp order is correct and no frames are lost.
[0130] During the writing of raw digital video frame units, it is necessary to verify the continuity of the frame header information of adjacent frames. The purpose of this verification is to ensure that the timestamp order is correct and that no frames are missing. If discontinuous timestamps or missing frames are found between adjacent frames, it indicates that there may have been a problem with the data processing, and appropriate action needs to be taken.
[0131] Step S15104: After all the original digital video frame units have been written, perform an overall verification on the data in the sequence storage buffer, calculate the checksum of the data and compare it with the preset check value.
[0132] After all the original digital video frame units have been written to the sequence storage buffer, the data needs to be verified as a whole. By calculating the checksum of the data and comparing it with a preset check value, the integrity and accuracy of the data can be verified.
[0133] Step S15105: When the verification passes, the data in the sequence storage buffer is output as the original digital video signal to complete the splicing operation.
[0134] If the data verification passes, it means that the data in the sequence storage buffer is complete and accurate, and it can be output as the original digital video signal to complete the splicing operation of the original digital video signal.
[0135] Step S1511: Perform digital-to-analog conversion on the recovered original digital video signal to output the original analog video signal.
[0136] In this embodiment, S1511 may include the following sub-steps S15111-S15115, which will be described in detail below.
[0137] Step S15111: Read each video frame unit in the recovered original digital video signal and input them into the digital-to-analog converter module in sequence according to the time sequence.
[0138] After reversing the pixel positions and stitching the original digital video signal, the recovered original digital video signal needs to undergo digital-to-analog conversion. First, each video frame unit in the original digital video signal is read sequentially according to the time sequence and input into the digital-to-analog conversion module.
[0139] Step S15112: The digital-to-analog conversion module performs digital-to-analog signal conversion processing on the input video frame unit to generate the corresponding analog video frame signal.
[0140] After receiving the video frame unit, the digital-to-analog converter (DAC) converts the discrete digital signal into a continuous analog signal, generating the corresponding analog video frame signal. This analog video frame signal contains the image information of the original video.
[0141] Step S15113: Output the analog video frame signals continuously in time sequence to form a continuous analog video signal stream.
[0142] By continuously outputting the generated analog video frame signals in a time sequence, a continuous analog video signal stream can be formed. This analog video signal stream can be received and processed by display devices or storage devices.
[0143] Step S15114: Perform signal conditioning processing on the analog video signal stream, adjusting the amplitude and frequency of the signal to conform to the preset analog video signal standard.
[0144] To ensure that analog video signal streams can be displayed or stored correctly, they need to be processed for signal conditioning. This involves adjusting the amplitude and frequency of the signal to conform to preset analog video signal standards.
[0145] Step S15115: Output the conditioned analog video signal stream to a display device or storage device to complete the recovery and output of the original analog video signal.
[0146] After signal conditioning, the analog video signal stream is output to a display device or storage device. The display device can show the video signal for the user to watch; the storage device can save the video signal for later use. This completes the restoration and output of the original analog video signal.
[0147] Furthermore, based on the above implementation method, step S150 performs pixel position inverse rearrangement processing on the digital video signal to be decrypted to generate the original digital video signal. In addition to the conventional inverse rearrangement method based on rows and columns, an inverse rearrangement implementation method based on a specific geometric region (or a preset geometric region) can also be adopted.
[0148] When reversing pixel positions by specific geometric regions, it's crucial to first ensure that the digital video signal to be decrypted has been previously encrypted using these specific geometric regions. Similarly, each video frame of the signal is first divided into multiple identical specific geometric regions, such as triangles, squares, and hexagons, according to the encryption rules. After the user sets the same random number as during encryption, the video processing terminal retrieves the corresponding pixel position mapping table (based on the geometric region) from storage and generates a reverse pixel position mapping table. This reverse mapping table meticulously records the original position index of each pixel within each geometric region. For example, for pixels within a square region, the reverse mapping table precisely indicates the position of each pixel in the original video frame. The video processing terminal begins processing from the first geometric region of the video frame, allocating a temporary storage area for that region. It then iterates through each pixel within the region, writing the pixel value to the storage address indicated by the original position index in the temporary storage area according to the reverse mapping table. After the iteration is complete, the pixel values are read sequentially by storage address to obtain the restored pixel data units for that geometric region. Next, the same reverse rearrangement operation is performed on each other geometric region of the video frame in turn. Finally, all the restored geometric regions are combined to form the original digital video frame unit, and then the video frames are spliced together in time sequence to form the original digital video signal.
[0149] Thus, this inverse rearrangement implementation, based on specific geometric regions, effectively ensures the accuracy of video decryption. Since inverse rearrangement is based on the specific geometric region division during encryption and the corresponding inverse mapping table, it can accurately restore pixel positions to their original state, ensuring the integrity of the original video information. At the same time, it maintains the complexity and randomness of encryption, ensuring that the encryption pattern is not exposed even during decryption due to conventional inverse rearrangement methods. This not only guarantees accurate decryption of encrypted videos for different users and in different application scenarios but also further strengthens the security and reliability of the entire encryption / decryption system.
[0150] It should be understood that throughout the entire analog video encryption and decryption process mentioned in this embodiment, the data processing and operations involved must strictly adhere to the principles of uniformity of units and matching of feature dimensions. For example, when performing pixel position rearrangement and derearrangement operations, the dimension of the pixel position index and the pixel value must remain consistent to ensure the accuracy and integrity of the data. Similarly, when performing digital-to-analog conversion and analog-to-digital conversion, the units of the input and output signals must also match to avoid mismatches in units.
[0151] Users can choose appropriate random numbers based on their needs and security requirements. Different random numbers correspond to different pixel position mapping tables and inverse mapping tables, thus achieving different encryption and decryption effects. In practical applications, increasing the number of selectable random numbers can improve encryption security, significantly increasing the difficulty of cracking encrypted videos.
[0152] During data storage and processing, effective data management and protection are essential. Important data such as pixel location mapping tables, inverse mapping tables, and metadata require backup and encrypted storage to prevent loss or tampering. Simultaneously, secure transmission protocols must be employed during data transmission to ensure data security and integrity.
[0153] When collecting and processing privacy-sensitive data, appropriate privacy protection and leak prevention technologies must be adopted. For example, video data can be anonymized to remove personally identifiable information; encryption algorithms can be used to encrypt the data during storage and transmission to prevent it from being stolen during transmission and storage.
[0154] In practical applications, such as in a drone-based simulated video transmission system, after the drone captures the original simulated video signal, it is processed using the encryption and decryption methods described above. The encrypted simulated video signal can be securely transmitted via simulated video transmission. Upon receiving the encrypted simulated video signal, the receiving end decrypts it to recover the original simulated video signal and displays it. Throughout this process, the security of the video information is effectively guaranteed due to the use of random numbers and pixel position rearrangement encryption. Even if the video signal is intercepted during transmission, attackers cannot directly obtain any useful information.
[0155] Through the detailed steps and scenario descriptions above, those skilled in the art can clearly understand and implement this simulated video encryption / decryption method, and can make corresponding adjustments and optimizations according to actual needs. In actual development and application, continuous testing and verification are necessary to ensure the system's stability and reliability. Simultaneously, with continuous technological advancements, further improvements and upgrades to the encryption / decryption algorithm may be needed to adapt to new security requirements and application scenarios. For example, new encryption technologies and algorithms can be combined to further enhance encryption strength and security; or the data processing and transmission flow can be optimized to reduce latency during encryption / decryption and improve system performance. Furthermore, the encryption / decryption method can be integrated with other related technologies, such as video compression and image recognition, to achieve richer functionality and a better user experience. In actual deployment, reasonable configuration and optimization based on specific hardware and software environments are required to ensure efficient and stable system operation. For different application scenarios, such as drone monitoring and intelligent security, targeted adjustments and optimizations to the algorithm may be necessary to meet the needs of different scenarios. During data collection and processing, strict adherence to relevant laws, regulations, and privacy policies is essential to ensure the legality and security of the data. To address potential anomalies and errors, appropriate error handling mechanisms need to be designed to ensure the system's robustness and reliability. During system maintenance and upgrades, relevant documentation and code should be updated and improved promptly to facilitate subsequent development and maintenance. Furthermore, by incorporating the latest industry trends and technological advancements, continuously introducing new technologies and methods can further drive the progress and development of analog video encryption and decryption technology.
[0156] Based on the above, such as Figure 3The diagram shown is a schematic of an analog video encryption / decryption system provided in an embodiment of this application. The system includes components such as a processor, a machine-readable storage medium, and input / output devices. The machine-readable storage medium is connected to the processor and is used to store programs, instructions, or code. The processor executes the programs, instructions, or code in the machine-readable storage medium to implement the aforementioned analog video encryption / decryption method. The analog video encryption / decryption system can be understood as being described in this application. Figure 1 The application scenario shown can be a part of the video processing terminal, or it could be the video processing terminal itself.
[0157] The machine-readable storage medium may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), etc. The machine-readable storage medium is used to store a program, which the processor executes upon receiving an execution instruction.
[0158] The processor may be an integrated circuit chip with signal processing capabilities. The processor mentioned above can be, but is not limited to, a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), etc.
[0159] In summary, the analog video encryption and decryption method and system provided in this application, by performing analog-to-digital conversion on the original analog video signal in the digital domain and rearranging the pixel positions, destroys the spatial correlation of pixels in the video image, making it difficult for the human eye to obtain useful information from the encrypted video, thus effectively improving the encryption strength of analog video.
[0160] Furthermore, random numbers are used to determine the pixel position mapping rules, with different random numbers corresponding to different pixel position swapping methods, further increasing the flexibility and security of encryption. Simultaneously, utilizing a large number of selectable random numbers ensures isolation between different users, avoiding encryption failure when users possess the same decryption module. Through a complete encryption / decryption process, including analog-to-digital conversion, pixel position rearrangement, digital-to-analog conversion, and inverse rearrangement, the original analog video signal can be accurately recovered, ensuring the integrity and accuracy of video information and providing reliable technical support for the secure application of analog image transmission in fields such as drones.
[0161] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. The embodiments, implementation methods, and related technical features of this application can be combined and substituted with each other without conflict. The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A method for encrypting and decrypting analog video, characterized in that, The method includes: The original analog video signal is subjected to analog-to-digital conversion to obtain the original digital video signal. The original digital video signal contains multiple video frame units arranged in a time sequence, and each video frame unit is composed of multiple pixel data units. The original digital video signal is subjected to pixel position rearrangement processing to generate an encrypted digital video signal. The pixel position rearrangement processing includes swapping the positions of pixels in each pixel unit based on a preset mapping rule. The encrypted digital video signal is subjected to digital-to-analog conversion to obtain an encrypted analog video signal; The encrypted analog video signal is subjected to analog-to-digital conversion to obtain the digital video signal to be decrypted; The pixel position inverse rearrangement process is performed on the digital video signal to be decrypted to generate the original digital video signal. The pixel position inverse rearrangement process includes performing a position recovery operation on the pixels in each pixel unit based on a preset inverse mapping rule, and performing digital-to-analog conversion processing on the recovered original digital video signal to output the original analog video signal.
2. The analog video encryption / decryption method according to claim 1, characterized in that, The step of performing pixel position rearrangement processing on the original digital video signal to generate an encrypted digital video signal includes: Obtain a random number set by the user; the random number is used to determine the index information of the pixel position mapping rule. The corresponding pixel position mapping table is retrieved from the storage unit based on the random number. The pixel position mapping table contains the target position index of each pixel in each row of pixel data units of each video frame unit in the original digital video signal. The frame header information of the current frame is extracted from the original digital video signal. The frame header information is used to indicate the total number of rows in the current frame and the starting position identifier of each row of pixel data units. Based on the frame header information, locate the first row of pixel data units in the current frame, and perform row count initialization processing on the first row of pixel data units, setting the row count parameter to the initial value; Find the target position index corresponding to each pixel in the current row of pixel data units from the pixel position mapping table. The target position index is the position identifier of the current pixel in the rearranged row of pixel data units. According to the target position index, perform a position swap operation on the pixels in the current row pixel data unit to generate a rearranged row pixel data unit. The position swap operation is to move the current pixel from its original position to the position indicated by the target position index. Determine whether the current row pixel data unit is the last row pixel data unit of the current frame; When the judgment result is negative, the row count parameter is incremented, and the process returns to the step of finding the target position index corresponding to each pixel in the current row of pixel data units from the pixel position mapping table, and continues to process the next row of pixel data units. When the judgment result is yes, all rearranged row pixel data units in the current frame are combined in row order to form the encrypted digital video frame unit of the current frame; The encrypted digital video signal is generated by splicing the encrypted digital video frame units according to a time sequence, and the time sequence is consistent with the time sequence of the video frame units in the original digital video signal.
3. The analog video encryption / decryption method according to claim 2, characterized in that, The step of retrieving the corresponding pixel position mapping table from the storage unit based on the random number includes: The random number is verified to see if it meets the preset numerical range requirement, which is the index range of the pixel position mapping table pre-stored in the storage unit. When the verification passes, the metadata of the mapping table associated with the random number is read from the storage unit. The metadata of the mapping table includes the total number of rows of the pixel position mapping table, the number of pixels in each row, and the data verification code. Based on the total number of rows and the number of pixels per row, the pixel position mapping table is checked for completeness to ensure that the mapping table contains all the target position indices of each row of pixel data units for each video frame unit. The pixel position mapping table is checked for data consistency using the data verification code to ensure that the retrieved pixel position mapping table has not been corrupted or tampered with. When both the integrity check and the data consistency check pass, the pixel position mapping table is loaded into the processing buffer for subsequent row pixel data unit position mapping operations.
4. The analog video encryption / decryption method according to claim 2, characterized in that, The step of performing a position swap operation on the pixels in the current row pixel data unit according to the target position index to generate a rearranged row pixel data unit includes: A temporary storage buffer is allocated for the current row pixel data unit, and the capacity of the temporary storage buffer is the same as the number of pixels in the current row pixel data unit; Traverse each pixel in the current row of pixel data units, and read the original position identifier and corresponding pixel value of each pixel in turn; For each pixel, the corresponding target location index is looked up from the pixel location mapping table based on its original location identifier; Write the read pixel value to the storage address indicated by the target location index in the temporary storage buffer; After the traversal is completed, all pixel values in the temporary storage buffer are read in order of storage address to form the rearranged row pixel data unit; Release the temporary storage buffer area and complete the position swapping operation of the current row pixel data unit.
5. The analog video encryption / decryption method according to claim 1, characterized in that, The step of performing pixel position inverse rearrangement processing on the digital video signal to be decrypted to generate the original digital video signal includes: Obtain a random number set by the user, and the random number is consistent with the random number used in the encryption process; The corresponding pixel position mapping table is retrieved from the storage unit based on the random number, and a pixel position inverse mapping table is generated according to the pixel position mapping table. The pixel position inverse mapping table contains the original position index of each pixel in each row of pixel data units of each video frame unit in the digital video signal to be decrypted. Extract the frame header information of the current frame from the digital video signal to be decrypted. The frame header information is used to indicate the total number of rows in the current frame and the starting position identifier of each row of pixel data units. Based on the frame header information, locate the first row of pixel data units in the current frame, and perform row count initialization processing on the first row of pixel data units, setting the row count parameter to the initial value; Find the original position index corresponding to each pixel in the current row pixel data unit from the pixel position inverse mapping table. The original position index is the position identifier of the current pixel in the original row pixel data unit. Based on the original position index, a position recovery operation is performed on the pixels in the current row pixel data unit to generate a recovered row pixel data unit. The position recovery operation is to move the current pixel from the encrypted position to the position indicated by the original position index. Determine whether the current row pixel data unit is the last row pixel data unit of the current frame, and the basis for the determination is whether the current row count parameter is equal to the total number of rows indicated by the frame header information; When the judgment result is negative, the row count parameter is incremented, and the process returns to the step of finding the original position index corresponding to each pixel in the current row of pixel data units from the inverse mapping table of pixel positions, and continues to process the next row of pixel data units. When the judgment result is yes, all recovered row pixel data units in the current frame are combined in row order to form the original digital video frame unit of the current frame; The original digital video frame units are spliced together in a time sequence to generate the original digital video signal, and the time sequence is consistent with the time sequence of the video frame units in the digital video signal to be decrypted.
6. The analog video encryption / decryption method according to claim 5, characterized in that, The step of generating the inverse pixel position mapping table based on the pixel position mapping table includes: Traverse the target position index set corresponding to each row of pixel data units in each video frame unit of the pixel position mapping table; For each row of pixel data units, construct a mapping pair between the original position identifier and the target position index, where the original position identifier is the position of the pixel in the original row of pixel data units, and the target position index is the position of the pixel in the rearranged row of pixel data units; The mapping pairs are reversed, with the target location index as the key and the original location identifier as the value, to generate a set of reverse mapping pairs; The inverse mapping relationship set is stored row by row to form the pixel position inverse mapping table. The structure of the pixel position inverse mapping table is consistent with the structure of the pixel position mapping table, and contains the same total number of rows and the number of pixels per row. The generated inverse pixel position mapping table is verified by randomly selecting multiple mapping pairs from the pixel position mapping table and performing a reverse lookup through the inverse pixel position mapping table to verify whether the original position identifier obtained by the reverse lookup is consistent with the original position identifier in the selected mapping pair.
7. The analog video encryption / decryption method according to claim 5, characterized in that, The step of performing a position recovery operation on the pixels in the current row pixel data unit according to the original position index to generate the recovered row pixel data unit includes: A temporary storage buffer is allocated for the current row pixel data unit, and the capacity of the temporary storage buffer is the same as the number of pixels in the current row pixel data unit; Traverse each pixel in the current row of pixel data units, and read the encrypted position identifier and corresponding pixel value of each pixel in turn; For each pixel, the corresponding original position index is looked up from the pixel position inverse mapping table based on its encrypted position identifier; Write the read pixel value to the storage address indicated by the original position index in the temporary storage buffer; After the traversal is complete, all pixel values in the temporary storage buffer are read in order of storage address to form the restored row pixel data unit; Release the temporary storage buffer area to complete the position recovery operation of the current row pixel data unit.
8. The analog video encryption / decryption method according to claim 5, characterized in that, The step of splicing the original digital video frame units according to a time sequence to generate the original digital video signal includes: A sequence storage buffer is allocated to the original digital video signal, and the capacity of the sequence storage buffer is determined based on the total number of frames of the digital video signal to be decrypted and the amount of data per frame. Starting from the first raw digital video frame unit, each raw digital video frame unit is written into the sequence storage buffer in timestamp order; During the writing process, the frame header information of adjacent original digital video frame units is continuously checked to ensure that the timestamp order is correct and no frames are lost. After all the original digital video frame units have been written, the data in the sequence storage buffer is checked as a whole, the checksum of the data is calculated and compared with the preset check value; When the verification passes, the data in the sequence storage buffer is output as the original digital video signal, completing the splicing operation.
9. The analog video encryption / decryption method according to claim 1, characterized in that, The step of performing digital-to-analog conversion on the recovered original digital video signal to output the original analog video signal includes: Read each video frame unit from the recovered original digital video signal and input them sequentially into the digital-to-analog converter module according to the time sequence; The digital-to-analog conversion module performs digital-to-analog signal conversion processing on the input video frame units to generate corresponding analog video frame signals; The analog video frame signals are continuously output in a time sequence to form a continuous analog video signal stream; The analog video signal stream is subjected to signal conditioning processing to adjust the amplitude and frequency of the signal to conform to a preset analog video signal standard; The conditioned analog video signal stream is output to a display device or storage device to complete the restoration and output of the original analog video signal.
10. An analog video encryption / decryption system, characterized in that, The method includes a processor and a machine-readable storage medium connected to the processor. The machine-readable storage medium is used to store programs, instructions, or code, and the processor is used to execute the programs, instructions, or code in the machine-readable storage medium to implement the method of any one of claims 1-9.