CN111932430B - Image encryption method based on FPGA - Google Patents

Image encryption method based on FPGA Download PDF

Info

Publication number
CN111932430B
CN111932430B CN202010040430.1A CN202010040430A CN111932430B CN 111932430 B CN111932430 B CN 111932430B CN 202010040430 A CN202010040430 A CN 202010040430A CN 111932430 B CN111932430 B CN 111932430B
Authority
CN
China
Prior art keywords
fpga
image
signal
encryption
random sequence
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010040430.1A
Other languages
Chinese (zh)
Other versions
CN111932430A (en
Inventor
严飞
刘伟奇
蔡静怡
刘银萍
陆宝毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Information Science and Technology
Original Assignee
Nanjing University of Information Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN202010040430.1A priority Critical patent/CN111932430B/en
Publication of CN111932430A publication Critical patent/CN111932430A/en
Application granted granted Critical
Publication of CN111932430B publication Critical patent/CN111932430B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/0021Image watermarking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Transmission Control (AREA)

Abstract

The invention discloses an image encryption method based on an FPGA, which comprises the following steps: initializing a dynamic random access memory by an FPGA; (2) the FPGA reads the original image; (3) The FPGA acquires time sequence information of an original image, and establishes a random sequence; (4) respectively performing encryption operation and storing the image. The invention has no requirement on the length of the key and has wider application range; the requirement on image data encryption can be met by adding a simple random sequence with a known initial value, the security performance is high, the data loss caused by too slow encryption speed is avoided, and the image data encryption processing efficiency is improved; the added random sequence combination initial value is known, the pixel clock Pclk signal is known, the operability is high, and the reduction degree is high; the random sequence is generated randomly and variously, the generated key stream is also diversified, the encryption effect is stronger, and the practicability is higher.

Description

一种基于FPGA的图像加密方法A Method of Image Encryption Based on FPGA

技术领域technical field

本发明涉及图像加密方法,尤其涉及一种基于FPGA的图像加密方法。The invention relates to an image encryption method, in particular to an FPGA-based image encryption method.

背景技术Background technique

图像加密技术一般可分为两类,即空域图像加密技术和压缩图像加密技术。如发明专利CN 107659753 B主要是提供了一种图像的压缩加密方法,对初始密钥进行T次哈希运算,根据所述T个哈希值得到测量矩阵,利用所述测量矩阵对所述列向量进行半张量压缩感知,以得到加密后图像;该发明虽然具有较好的保密性,但是原来明文图像的相邻行和相邻列的强相关性,且计算量大、速度慢,安全性完全取决于密钥的长度,操作性任然有待提升。又例如发明专利CN 105513002 B通过行与行之间的模运算以及列与列之间的模运算,改变了图像的像素和,打破原来明文图像的相邻行和相邻列的强相关性;改变了传统算法对不同图像进行加密时所采用的相同密钥流的问题;通过图像的灰度值扩散运算,建立起相邻两像素间的互相影响,密钥直接参与密文图像的输出;该发明虽然能够部分有效地防止暴力攻击,但是图像在加密过程中所使用密钥流与明文图像无关,这导致了对不同图像进行加密时,所用的密钥流保持一致不变。Image encryption technology can generally be divided into two categories, namely airspace image encryption technology and compressed image encryption technology. For example, the invention patent CN 107659753 B mainly provides an image compression and encryption method, which performs T hash operations on the initial key, obtains a measurement matrix according to the T hash values, and uses the measurement matrix to calculate the column The semi-tensor compressed sensing of the vector is used to obtain the encrypted image; although this invention has better confidentiality, the original plaintext image has a strong correlation between adjacent rows and adjacent columns, and the calculation is large and slow, which is safe. The performance depends entirely on the length of the key, and the operability still needs to be improved. Another example is the invention patent CN 105513002 B, which changes the pixel sum of the image through the modular operation between rows and columns and breaks the strong correlation between adjacent rows and adjacent columns of the original plaintext image; The problem of the same key stream used by the traditional algorithm to encrypt different images is changed; through the gray value diffusion operation of the image, the mutual influence between two adjacent pixels is established, and the key directly participates in the output of the ciphertext image; Although the invention can partially effectively prevent brute force attacks, the key stream used in the image encryption process has nothing to do with the plaintext image, which leads to the same key stream used when encrypting different images.

因此,利用混沌加密法进行图像加密的方式,都存在一定的共性问题。虽然可以抵抗已知明文系统攻击,但是明文图像特征“像素和”在扩散前没有变化,容易造成差分攻击;秘密密钥在加密过程中仅仅用于生成密钥流,并没有直接参与密文图像的获取;加密算法只考虑图像的像素位置的置乱,最终输出文件的安全性完全取决于密钥的长度,并且加密速度慢,无法满足一些简洁快速的加密需求。Therefore, there are certain common problems in the way of image encryption using chaotic encryption method. Although it can resist the known plaintext system attack, the feature "pixel sum" of the plaintext image does not change before the diffusion, which is easy to cause differential attacks; the secret key is only used to generate the key stream in the encryption process, and does not directly participate in the ciphertext image The encryption algorithm only considers the scrambling of the pixel position of the image, the security of the final output file depends entirely on the length of the key, and the encryption speed is slow, which cannot meet some simple and fast encryption requirements.

发明内容Contents of the invention

发明目的:本发明的目的是提供一种快速有效对图像进行实时加密保护的基于FPGA的图像加密方法。Purpose of the invention: the purpose of this invention is to provide a kind of FPGA-based image encryption method that carries out real-time encryption protection to image quickly and effectively.

技术方案:本发明所述的加密方法包括如下步骤:(1)FPGA对动态随机存储器初始化;(2)FPGA读取原始图像;(3)FPGA获取原始图像的时序信息,FPGA建立随机序列;(4)分别进行加密运算并存储图像。Technical scheme: encryption method of the present invention comprises the steps: (1) FPGA initializes DRAM; (2) FPGA reads original image; (3) FPGA obtains the timing information of original image, and FPGA sets up random sequence; ( 4) Carry out encryption operation and store the image respectively.

步骤(3)中FPGA读取随机存储器DDR中的信息,得到原始图像的行同步信号、场同步信号、行后沿信号、行前沿信号、列后沿信息、列前沿信息、行使能信号的像素点数据信息;当遇到像素时钟Pclk信号时,FPGA对原始图像同时进行行同步Hsync和场同步Vsync计数。In step (3), the FPGA reads the information in the random access memory DDR to obtain the row synchronization signal, field synchronization signal, row rear edge signal, row front edge signal, column rear edge information, column front edge information, and row enable signal pixels of the original image Point data information; when encountering the pixel clock Pclk signal, the FPGA simultaneously counts the horizontal synchronization Hsync and the vertical synchronization Vsync of the original image.

步骤(3)中FPGA内部D触发器和门电路构成随机序列;一共有8个D触发器,3个与门,4个异或门电路,分别组合形成不同组合序列的随机序列;FR(X)[7:0]、FG(X)[7:0]、FB(X)[7:0]3个随机序列的发生器与门数字电路的位置不变,异或数字电路信号为从DFF0开始分别依次后移一位;随机序列FR(X)、FG(X)、FB(X)具有初始值,且初始值为固定值,由行同步信号Hsync或者场同步信号Vsync决定。In step (3), the internal D flip-flops and gate circuits of the FPGA form a random sequence; there are 8 D flip-flops, 3 AND gates, and 4 XOR gate circuits, which are combined to form random sequences of different combination sequences; FR( X) [7:0], F G(X) [7:0], F B(X) [7:0] 3 random sequence generators and the position of the gate digital circuit remains unchanged, and the XOR digital circuit signal In order to start from DFF0 and shift back one bit respectively; the random sequence FR(X) , F G(X) and F B(X) has an initial value, and the initial value is a fixed value, which is determined by the horizontal synchronization signal Hsync or the field synchronization signal Vsync decides.

步骤(4)中分别对加密运算的信号进行行运算和列运算,得到有效的行使能DE,最终得到新的加密图像信号,并存储到动态随机存储器DDR中。In step (4), row operation and column operation are respectively performed on the encrypted signal to obtain effective row enable DE, and finally obtain a new encrypted image signal, and store it in the dynamic random access memory (DDR).

有益效果:本发明与现有技术相比,其显著效果如下:1、对密钥的长度没有要求,适用范围更广泛;2、通过添加简单的初始值已知的随机序列即可达到对图像数据加密的要求,安全性能高,避免了由于加密速度太慢导致数据丢失,提高了图像数据加密处理效率;3、添加的随机序列组合初始值已知、像素时钟Pclk信号已知,可操作性高、还原度高;4、随机序列的产生是任意的多样的,产生的密钥流也是多样性的,加密效果更强,实践性更高。Beneficial effects: Compared with the prior art, the present invention has the following remarkable effects: 1. There is no requirement for the length of the key, and the scope of application is wider; 2. By adding a simple random sequence with known initial values, the image Data encryption requirements, high security performance, avoiding data loss due to too slow encryption speed, and improving image data encryption processing efficiency; 3. The initial value of the added random sequence combination is known, the pixel clock Pclk signal is known, and operability High, high degree of restoration; 4. The generation of random sequences is arbitrary and diverse, and the generated key streams are also diverse, with stronger encryption effects and higher practicality.

附图说明Description of drawings

图1为本发明的图像加密的步骤流程图;Fig. 1 is the step flowchart of image encryption of the present invention;

图2为本发明的图像加密过程示意图;Fig. 2 is a schematic diagram of the image encryption process of the present invention;

图3为本发明的随机序列发生器示意图。Fig. 3 is a schematic diagram of the random sequence generator of the present invention.

具体实施方式Detailed ways

下面结合说明书附图和具体实施方式对本发明做进一步详细描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

如图1所示为本发明的图像加密的步骤流程图,图2所示为本发明的具体步骤,图3所示为本发明随机序列发生器示意。本发明所述的图像加密方法具体步骤如下:Figure 1 is a flow chart of the image encryption steps of the present invention, Figure 2 is the specific steps of the present invention, and Figure 3 is a schematic diagram of the random sequence generator of the present invention. The image encryption method concrete steps of the present invention are as follows:

(1)FPGA对外接动态随机存储器进行初始化,并使外接动态随机存储器能正常读取数据。(1) The FPGA initializes the external DRAM, and enables the external DRAM to read data normally.

(2)一副图像由RGB三色组成,FPGA读取原始图像,红绿蓝各8bit分别表示为R[7:0]、G[7:0]、B[7:0]。(2) An image is composed of three colors of RGB, and the FPGA reads the original image, and the 8 bits of red, green and blue are represented as R[7:0], G[7:0], and B[7:0] respectively.

(3)FPGA读取随机存储器DDR中的信息,获取原始图像的时序信息。得到原始图像的行同步信号、场同步信号、行后沿信号、行前沿信号、列后沿信息、列前沿信息、行使能信号等的像素点数据信息。(3) The FPGA reads the information in the random access memory DDR to obtain the timing information of the original image. Obtain the pixel point data information of the original image's line synchronization signal, field synchronization signal, line back edge signal, line front edge signal, column back edge information, column front edge information, row enable signal, etc.

FPGA内部D触发器和门电路构成随机序列。一共有8个D触发器,3个与门,4个异或门电路,分别组合形成不同组合序列的随机序列。其中,FR(X)[7:0]、FG(X)[7:0]、FB(X)[7:0]3个随机序列的发生器与门数字电路的位置不变,异或数字电路信号为从DFF0开始分别依次后移一位。数字电路清晰且复杂。最终得到数字不同的随机时序,均为8bit的变量。FPGA internal D flip-flops and gate circuits form a random sequence. There are a total of 8 D flip-flops, 3 AND gates, and 4 XOR gate circuits, which are combined to form random sequences of different combination sequences. Among them, FR (X) [7:0], F G(X) [7:0], F B(X) [7:0] 3 random sequence generators and gate digital circuit positions remain unchanged, The XOR digital circuit signals are sequentially shifted backward by one bit starting from DFF0. Digital circuits are clear and complex. In the end, random time series with different numbers are obtained, all of which are 8-bit variables.

(3-1)当遇到像素时钟Pclk信号时,FPGA对原始图像同时进行行同步Hsync和场同步Vsync计数。(3-1) When encountering the pixel clock Pclk signal, the FPGA simultaneously counts the horizontal synchronization Hsync and the vertical synchronization Vsync of the original image.

(3-2)将一副图像的大小看为V行H列,即每行有H个像素,总共有V行。当一行的行同步Hsync信号和行有效数据计数结束,进入新的一列并进行下一行的数据运算。当场同步Vsync信号和场有效数据计数结束,表示一帧图像读取结束。(3-2) Consider the size of an image as V rows and H columns, that is, each row has H pixels, and there are V rows in total. When the row synchronous Hsync signal and row valid data counting of one row is over, enter a new column and perform the data operation of the next row. When the counting of the field synchronous Vsync signal and field valid data ends, it means that the reading of one frame of image ends.

(3-3)随机序列FR(X)、FG(X)、FB(X)具有初始值,且初始值为固定值,由行同步信号Hsync或者场同步信号Vsync决定。但是随机序列的数值随像素时钟Pclk而变化,没有特定规律。(3-3) The random sequences FR (X) , F G(X) and F B(X) have initial values, and the initial values are fixed values, which are determined by the horizontal synchronization signal Hsync or the vertical synchronization signal Vsync. But the numerical value of the random sequence changes with the pixel clock Pclk, and there is no specific rule.

(3-4)当遇到像素时钟Pclk信号时,随机序列的FR(X)[7:0]与原图像的R[7:0]做异或加密运算的结果作为红色输出;(3-4) When the pixel clock Pclk signal is encountered, the result of the XOR encryption operation between the random sequence FR(X) [7:0] and the original image R[7:0] is output as red;

随机序列的FG(X)[7:0]与原图像的G[7:0]做异或加密运算的结果作为绿色输出;The F G(X) [7:0] of the random sequence and the G[7:0] of the original image are XORed and encrypted as a green output;

随机序列的FB(X)[7:0]与原图像的B[7:0]做异或加密运算的结果作为蓝色输出。The result of the XOR encryption operation between F B(X) [7:0] of the random sequence and B[7:0] of the original image is output in blue.

(4)分别对加密运算的R、G、B信号进行行运算和列运算,得到有效的行使能DE,最终得到新的加密图像信号,并存储到动态随机存储器DDR中。(4) Row operation and column operation are respectively performed on the encrypted R, G, and B signals to obtain an effective row enable DE, and finally obtain a new encrypted image signal, and store it in the dynamic random access memory DDR.

Claims (3)

1.一种基于FPGA的图像加密方法,其特征在于:包括如下步骤:(1)FPGA对动态随机存储器初始化;(2)FPGA读取原始图像;(3)FPGA获取原始图像的时序信息,FPGA建立随机序列;(4)分别进行加密运算并存储图像;1. An image encryption method based on FPGA, characterized in that: comprises the following steps: (1) FPGA initializes DRAM; (2) FPGA reads original image; (3) FPGA obtains the timing information of original image, and FPGA Establish a random sequence; (4) perform encryption operations and store images separately; 步骤(3)中FPGA读取随机存储器DDR中的信息,得到原始图像的行同步信号、场同步信号、行后沿信号、行前沿信号、列后沿信息、列前沿信息、行使能信号的像素点数据信息;In step (3), the FPGA reads the information in the random access memory DDR to obtain the row synchronization signal, field synchronization signal, row trailing edge signal, row leading edge signal, column trailing edge information, column leading edge information, and pixels of the row enable signal of the original image Point data information; 当遇到像素时钟Pclk信号时,FPGA对原始图像同时进行行同步Hsync和场同步Vsync计数;When the pixel clock Pclk signal is encountered, the FPGA simultaneously counts the horizontal synchronization Hsync and the vertical synchronization Vsync of the original image; 步骤(3)中FPGA内部D触发器和门电路构成随机序列;一共有8个D触发器,3个与门,4个异或门电路,分别组合形成不同组合序列的随机序列; FR(X)[7:0]、FG(X)[7:0]、FB(X)[7:0] 3个随机序列的发生器与门数字电路的位置不变,异或数字电路信号为从DFF0开始分别依次后移一位。In step (3), the internal D flip-flops and gate circuits of the FPGA form a random sequence; there are 8 D flip-flops, 3 AND gates, and 4 XOR gate circuits, which are combined to form random sequences of different combination sequences; F R( X) [7:0], F G(X) [7:0], F B(X) [7:0] 3 random sequence generators, the position of the AND gate digital circuit remains unchanged, and the XOR digital circuit signal In order to start from DFF0 and move backward one by one respectively. 2.根据权利要求1所述的基于FPGA的图像加密方法,其特征在于,随机序列FR(X)、FG(X)、FB(X)具有初始值,且初始值为固定值,由行同步信号Hsync或者场同步信号Vsync决定。2. the image encryption method based on FPGA according to claim 1, is characterized in that, random sequence FR (X) , F G (X) , F B (X) has initial value, and initial value is fixed value, It is determined by the horizontal sync signal Hsync or the vertical sync signal Vsync. 3.根据权利要求1所述的基于FPGA的图像加密方法,其特征在于,步骤(4)中分别对加密运算的信号进行行运算和列运算,得到有效的行使能DE,最终得到新的加密图像信号,并存储到动态随机存储器DDR中。3. The image encryption method based on FPGA according to claim 1, characterized in that, in step (4), row operation and column operation are respectively performed on the encrypted signal to obtain effective row enable DE, and finally obtain a new encryption The image signal is stored in the dynamic random access memory (DDR).
CN202010040430.1A 2020-01-15 2020-01-15 Image encryption method based on FPGA Active CN111932430B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010040430.1A CN111932430B (en) 2020-01-15 2020-01-15 Image encryption method based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010040430.1A CN111932430B (en) 2020-01-15 2020-01-15 Image encryption method based on FPGA

Publications (2)

Publication Number Publication Date
CN111932430A CN111932430A (en) 2020-11-13
CN111932430B true CN111932430B (en) 2023-05-26

Family

ID=73316143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010040430.1A Active CN111932430B (en) 2020-01-15 2020-01-15 Image encryption method based on FPGA

Country Status (1)

Country Link
CN (1) CN111932430B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113115053B (en) * 2021-04-08 2023-02-07 广东海洋大学 Image encryption method based on integer wavelet transform and compressed sensing

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888637A (en) * 2014-04-08 2014-06-25 广东工业大学 Method for chaotic encryption of multi-path image digital information
CN106293616A (en) * 2016-08-12 2017-01-04 西安电子科技大学 True Random Number Generator based on time delay feedback agitator
CN108322622A (en) * 2018-02-23 2018-07-24 哈尔滨理工大学 A kind of color digital image encryption method based on 2D-VMD and octuple hyperchaotic system
CN110337000A (en) * 2019-07-11 2019-10-15 南京信息工程大学 Reversible Information Hiding Method in Encrypted Domain Based on Double Binary Tree Expansion and Public Key Encryption

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10171229B2 (en) * 2015-06-25 2019-01-01 Instituto Potosino de Investigacion Cientifica y Tecnologica AC Pseudo-random bit generator based on multim-modal maps
US10740146B2 (en) * 2017-02-10 2020-08-11 Xilinx, Inc. Migrating virtual machines between compute systems by transmitting programmable logic accelerator state

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103888637A (en) * 2014-04-08 2014-06-25 广东工业大学 Method for chaotic encryption of multi-path image digital information
CN106293616A (en) * 2016-08-12 2017-01-04 西安电子科技大学 True Random Number Generator based on time delay feedback agitator
CN108322622A (en) * 2018-02-23 2018-07-24 哈尔滨理工大学 A kind of color digital image encryption method based on 2D-VMD and octuple hyperchaotic system
CN110337000A (en) * 2019-07-11 2019-10-15 南京信息工程大学 Reversible Information Hiding Method in Encrypted Domain Based on Double Binary Tree Expansion and Public Key Encryption

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
实时视频流缩放系统设计;严飞等;《液晶与显示》;第34卷(第11期);第1124-1130页 *
真随机数在数字图像加密中的应用;王吉宇等;《电视技术》;第37卷(第17期);第25-28页 *

Also Published As

Publication number Publication date
CN111932430A (en) 2020-11-13

Similar Documents

Publication Publication Date Title
Liu et al. Cryptanalysis and improvement in a plaintext-related image encryption scheme based on hyper chaos
CN104751401B (en) A kind of novel Piecewise linear chaotic map image encryption and coding method
CN106327414A (en) Plaintext feature-based double-chaos image encryption method
CN103491279A (en) 4-neighborhood exclusive or image encryption method based on hyper-chaos Lorenz system
Dhiman et al. Extended visual cryptography techniques for true color images
CN103440613B (en) The color image encrypting method of hyperchaos Rossler system
CN105513002A (en) Novel image encryption method based on correlation between chaos and plaintext
Mumthas et al. Transform domain video steganography using RSA, random DNA encryption and Huffman encoding
CN114579993B (en) Image encryption method based on quantum key distribution and pixel scrambling
CN108055121A (en) The encryption method and decryption method of image
CN114915400A (en) Synchronous time adjustable heterogeneous fractional order hyperchaotic system image encryption and decryption method
CN111932430B (en) Image encryption method based on FPGA
CN113595715B (en) Logistic double-pixel rectangular mapping color image encryption and decryption method
Singh et al. Image security using DES and RNS with reversible watermarking
CN104700348B (en) A kind of color image-adaptive encryption method based on high-order chaos system
Raniprima et al. Digital image steganography with encryption based on rubik's cube principle
Sreekumar et al. Advanced reversible data hiding with encrypted data
CN111314046B (en) Image encryption and decryption method based on Arnold transformation and fractional order chaotic sequence
CN116015680B (en) A secure blind signature method based on chaotic embedding of weak passwords
CN107169912A (en) A kind of improved method of Image Chaos encryption technology
Zhang et al. A fast image encryption algorithm using plaintext-related confusion
Munir Visual cryptography of animated GIF image based on XOR operation
Vithayathil et al. Image Encryption Through Aperiodic Josephus Permutation And Novel Cyclic Shift Operation
Bin et al. Image encryption algorithm based on chaotic map and S-DES
Benjeddou et al. A fast color image encryption scheme based on multidimensional chaotic maps

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant