TWI746296B - Homomorphic multi-level visual image encryption system and method and its application - Google Patents

Homomorphic multi-level visual image encryption system and method and its application Download PDF

Info

Publication number
TWI746296B
TWI746296B TW109141857A TW109141857A TWI746296B TW I746296 B TWI746296 B TW I746296B TW 109141857 A TW109141857 A TW 109141857A TW 109141857 A TW109141857 A TW 109141857A TW I746296 B TWI746296 B TW I746296B
Authority
TW
Taiwan
Prior art keywords
image
level
homomorphic
plaintext
cipher
Prior art date
Application number
TW109141857A
Other languages
Chinese (zh)
Other versions
TW202221543A (en
Inventor
林基源
王俊傑
楊勝智
林胤忱
林明臻
Original Assignee
國立勤益科技大學
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 國立勤益科技大學 filed Critical 國立勤益科技大學
Priority to TW109141857A priority Critical patent/TWI746296B/en
Application granted granted Critical
Publication of TWI746296B publication Critical patent/TWI746296B/en
Publication of TW202221543A publication Critical patent/TW202221543A/en

Links

Images

Abstract

本發明係揭露一種同態多階視覺影像加密系統與方法及其應用,其係將灰階明文影像經過量化處理後獲得多階明文影像,並將多階明文影像透過密本產生技術計算而得到複數密本影像,再將複數密本影像進行視覺加密,使複數密本影像須同時進行模運算相加及模運算相乘而可獲得明文影像,係分別將該複數密本影像與一組鑰匙(Pi)所形成的同餘方程式依序進行同態加密,以獲得複數同態密文影像,再以中國餘式定理對複數同態密文影像進行解密,以獲得解密的密本影像,俾能藉由視覺加密及同態加密等機能設置,因而除了具有影像密秘分享功能之外,並具有利用同態密碼對密秘分享的結果進一步加密的雙重保障的功能,而且視覺加密與同態加密的方法還可將密秘分享的優先順序進行排序,進而有效提升影像密秘的等級。 The present invention discloses a homomorphic multi-level visual image encryption system and method and its application. The gray-level plaintext image is quantified to obtain a multi-level plaintext image, and the multi-level plaintext image is calculated through a cipher copy generation technology. The complex cipher image is then visually encrypted, so that the complex cipher image must be modulo arithmetic addition and modulo arithmetic multiplication at the same time to obtain a plaintext image, which is the complex cipher image and a set of keys respectively (P i ) The formed congruence equations are sequentially homomorphically encrypted to obtain a complex homomorphic ciphertext image, and then the complex homomorphic ciphertext image is decrypted according to the Chinese remainder theorem to obtain a decrypted ciphertext image, It can be set by functions such as visual encryption and homomorphic encryption, so in addition to the image secret sharing function, it also has the double guarantee function of using the homomorphic password to further encrypt the result of the secret sharing, and the visual encryption and the same The method of state encryption can also sort the priority of secret sharing, thereby effectively improving the level of image secrets.

Description

同態多階視覺影像加密系統與方法及其應用 Homomorphic multi-level visual image encryption system and method and its application

本發明係有關一種同態多階視覺影像加密系統與方法及其應用,尤指一種可藉由視覺加密及同態加密等機能設置而具有影像密秘分享功能及具有利用同態密碼對密秘分享的結果進一步加密的雙重保障功能的同態多階視覺影像加密技術。 The present invention relates to a homomorphic multi-level visual image encryption system and method and its application, in particular to an image secret sharing function that can be set by visual encryption and homomorphic encryption, and can use homomorphic ciphers to encrypt secrets. The shared results are further encrypted with a homomorphic multi-level visual image encryption technology with dual guarantee functions.

一般來說,處在雲端時代裏,雲端服務是很重要的工作。客戶端的資料如果可以保密並傳給伺服器端服務是一個重要的問題,這一個問題可以利用數學的方法解決。依據所知,同態函數具有一個重要的特性是可以將運算映射至另一個場域進行,當映射回原場域時可以再利用同態反函數反回,因此透過同態加密(Homomorphic Encryption)的原理,讓客戶端的資料達到保密的目的,並且客戶端加密後的資料還能進行運算。在許多場合上需要這樣的系統如雲端服務與版權分享之應用。在科技一直進步下,個人電腦的運算將逐漸落寞,取而代之的是雲端上的各種運算服務,像是:基礎設施即服務(Infrastructure as a Service)、平台即服務(Platform as a Service)與軟體即服務(Software as a Service)等。而當我們把資料上傳到雲端,準備進行運算時,是否考慮過,我們的資料,將可能陷入服務平台偷窺的危機中,因此我們打算探討是否能夠在資料上傳雲端計算之前,先進行加密保護,讓雲端使用加密後的資料運算,並在使用端將回傳結果解密 後,可以得到與未加密前的運算資料一樣的結果。如果的設計不但可以讓客戶端的資料保密,亦可以讓伺服器進行資料的運算服務,這種方式可以稱為同態加密(Homomorphic Encryption) Generally speaking, in the cloud era, cloud services are very important tasks. If the client's data can be kept confidential and transmitted to the server-side service is an important problem, this problem can be solved by mathematical methods. As far as we know, an important feature of homomorphic functions is that they can be mapped to another field for operation. When mapped back to the original field, the inverse homomorphic function can be used to return, so through homomorphic encryption (Homomorphic Encryption) The principle of, let the client's data achieve the purpose of confidentiality, and the client's encrypted data can also be calculated. On many occasions, such systems as cloud services and copyright sharing applications are needed. With the continuous advancement of technology, the computing of personal computers will gradually become lonely, replaced by various computing services on the cloud, such as Infrastructure as a Service, Platform as a Service, and Software as a Service. Service (Software as a Service) etc. And when we upload data to the cloud and prepare for computing, have we considered that our data may fall into a crisis of peeping on the service platform, so we plan to explore whether we can encrypt and protect the data before uploading it to cloud computing. Let the cloud use the encrypted data to calculate, and decrypt the returned result on the user side After that, you can get the same result as the unencrypted calculation data. If the design can not only keep the client's data confidential, but also allow the server to perform data computing services, this method can be called Homomorphic Encryption.

再者,密秘分享是一種多人共用一個明文的加密方法。如大家欲共同擁有一個密秘即可利用此方法進行加密。視覺加密的發展有一個問題存在,即是當分享密秘者其中有一人收集到其他分享密秘者的密本之後,在有完整的密本情況下該人可以進行偽造或竄改,為求改善此一缺失,目前的做法,是在密秘分享的密本上再進行一次加密;惟大多數加密方法並沒有密文可運算的特性,以致無法滿足密秘分享欲回覆為明文的模數加法運算,因而造成使用上的不便與困擾的情事產生,因此如何開發出一套可以結合視覺加密及同態加密等機能設置而具有影像密秘分享及具有利用同態密碼對密秘分享的結果進一步加密功能的同態多階視覺影像加密技術,實已成為相關技術領域業者所亟欲挑戰與解決的技術課題。 Furthermore, secret sharing is an encryption method in which multiple people share a plaintext. If you want to share a secret, you can use this method for encryption. There is a problem in the development of visual encryption, that is, when one of the shared secrets has collected the secrets of other shared secrets, the person can forge or alter the secrets if there is a complete secret, in order to improve. For this lack, the current practice is to perform another encryption on the secret shared secret; however, most encryption methods do not have the feature of ciphertext operation, so that the secret sharing wants to reply to the plaintext modulus addition cannot be satisfied. Calculations, resulting in inconvenience and troubles in use. Therefore, how to develop a set of functions that can combine visual encryption and homomorphic encryption to have image secret sharing and the result of using homomorphic passwords to share secrets. The homomorphic multi-level visual image encryption technology with encryption function has actually become a technical issue that the industry in the related technical field urgently wants to challenge and solve.

有鑑於此,上述習知影像加密技術確實皆未臻完善,仍有再改善的必要性,而且基於相關產業的迫切需求之下,本發明人乃憑藉多年訓練器材設計之實務經驗及相關的專業知識,經不斷的努力研發之下,終於研發出一種有別於上述習知技術與前揭專利的本發明。 In view of this, none of the above-mentioned conventional image encryption technologies is perfect, and there is still a need for improvement. Moreover, based on the urgent needs of related industries, the inventor relies on years of practical experience in training equipment design and related expertise. Knowledge, through continuous efforts in research and development, finally developed an invention that is different from the above-mentioned conventional technology and the previously disclosed patent.

本發明主要目的,在於提供一種同態多階視覺影像加密系統與方法及其應用,主要是藉由視覺加密及同態加密等機能設置,因而除了具有影像密秘分享功能之外,並具有利用同態密碼對密秘分享的結果 進一步加密的雙重保障的功能,而且視覺加密與同態加密的方法還可將密秘分享的優先順序進行排序,進而有效提升影像密秘的等級。達成本發明主要目的之技術手段,係將灰階明文影像經過量化處理後獲得多階明文影像,並將多階明文影像透過密本產生技術計算而得到複數密本影像,再將複數密本影像進行視覺加密,使複數密本影像須同時進行模運算相加及模運算相乘而可獲得明文影像,係分別將該複數密本影像與一組鑰匙(Pi)所形成的同餘方程式依序進行同態加密,以獲得複數同態密文影像,再以中國餘式定理對複數同態密文影像進行解密,以獲得解密的密本影像。 The main purpose of the present invention is to provide a homomorphic multi-level visual image encryption system and method and its application, which are mainly set by visual encryption and homomorphic encryption, etc., so that in addition to the image secret sharing function, it also has the use of The homomorphic password further encrypts the result of secret sharing, and the double guarantee function, and the visual encryption and homomorphic encryption methods can also sort the priority of secret sharing, thereby effectively improving the level of image secret. The technical means to achieve the main purpose of the invention is to quantify the gray-scale plaintext image to obtain a multi-level plaintext image, and calculate the multi-level plaintext image through the cipher generation technology to obtain a complex cipher image, and then combine the complex cipher image For visual encryption, the complex cipher image must be combined and multiplied by modular arithmetic at the same time to obtain a plaintext image. The congruence equation formed by the complex cipher image and a set of keys (P i) is based on The sequence is homomorphic encryption to obtain a complex homomorphic ciphertext image, and then the complex homomorphic ciphertext image is decrypted according to the Chinese remainder theorem to obtain a decrypted ciphertext image.

圖1 係本發明多階影像錯誤分散方塊示意圖。 FIG. 1 is a schematic diagram of a multi-level image error dispersion block diagram of the present invention.

圖2 係本發明多階影像的產生的圖形轉換實施示意圖。 FIG. 2 is a schematic diagram of the implementation of graphics conversion for generating multi-level images of the present invention.

圖3 係本發明多階影像視覺加密的實施示意圖。 Figure 3 is a schematic diagram of the implementation of the multi-level image visual encryption of the present invention.

圖4 係本發明同態多階影像視覺加密的實施示意圖。 Figure 4 is a schematic diagram of the implementation of the homomorphic multi-level image visual encryption of the present invention.

圖5 係本發明同態密碼加密方法的流程實施示意圖。 Figure 5 is a schematic diagram of the process implementation of the homomorphic cipher encryption method of the present invention.

圖6 係本發明同態密碼加密的方塊控制實施示意圖。 Figure 6 is a schematic diagram of block control implementation of homomorphic cipher encryption according to the present invention.

圖7 係本發明同態密碼解密的方塊控制實施示意圖。 Figure 7 is a schematic diagram of block control implementation of homomorphic encryption decryption according to the present invention.

圖8 係本發明視覺加密運算封包結構的實施示意圖。 FIG. 8 is a schematic diagram of the implementation of the visual encryption calculation packet structure of the present invention.

圖9 係本發明封包表頭為後序的運算產生實施示意圖。 Fig. 9 is a schematic diagram of the implementation of the post-sequence calculation of the packet header of the present invention.

為讓 貴審查委員能進一步瞭解本發明整體的技術特徵與達成本發明目的之技術手段,玆以具體實施例並配合圖式加以詳細說明如下: In order to allow your reviewer to further understand the overall technical features of the present invention and the technical means to achieve the purpose of the invention, specific examples and drawings are used to describe in detail as follows:

請配合參看圖1~4所示,為達成本發明主要目之具體實施例,係包括下列步驟: Please refer to Figs. 1~4. In order to achieve the main purpose of the invention, the specific embodiment includes the following steps:

多階影像產生步驟,係將灰階明文影像經過量化處理後獲得多階明文影像。 The multi-level image generation step is to obtain a multi-level plain text image after quantizing the gray-level plain text image.

視覺加密步驟,將該多階明文影像透過一密本產生技術計算而得到複數密本影像,將複數密本影像進行視覺加密,使複數密本影像須同時進行模運算相加及模運算相乘而可獲得明文影像。 In the visual encryption step, the multi-level plaintext image is calculated by a cipher generation technology to obtain a complex cipher image, and the complex cipher image is visually encrypted, so that the complex cipher image must be subjected to modular operation addition and modular operation multiplication at the same time The plaintext image can be obtained.

同態加密步驟,分別將複數密本影像與一組鑰匙(Pi)所形成的同餘方程式依序進行同態加密,以獲得複數同態密文影像。 In the homomorphic encryption step, the congruence equations formed by the complex cipher image and a set of keys (P i ) are respectively homomorphically encrypted in sequence to obtain the complex homomorphic ciphertext image.

同態解密步驟,以中國餘式定理對該複數同態密文影像進行解密,以獲得解密的密本影像,再代入視覺加密步驟,使複數密本影像須同時進行模運算相加及模運算相乘而可獲得還原的明文影像。 In the homomorphic decryption step, the complex number homomorphic ciphertext image is decrypted according to the Chinese remainder theorem to obtain the decrypted ciphertext image, and then substituted into the visual encryption step, so that the complex ciphertext image must be subjected to modular addition and modular operation at the same time Multiply together to get the restored plaintext image.

本發明圖1所示的實施例中,於多階影像產生步驟中,該明文影像係以多階臨界值(ti)進行量化處理而獲得多階明文影像,並將明文影像減去多階明文影像而得到錯誤分散值e x,y ,再將錯誤分散值e x,y 代入一錯誤濾波技術進行濾波處理,以將濾波處理結果與明文影像相加後進行多階臨界值(ti)的量化處理,以得到下一個多階明文影像,然後重覆上述步驟,直到得到最後一個多階明文影像為止。 In the embodiment shown in FIG. 1 of the present invention, in the step of generating the multi-level image, the plain text image is quantized with a multi-level threshold (t i ) to obtain a multi-level plain text image, and the plain text image is subtracted from the multi-level plain text image. The error dispersion value e x, y is obtained from the plaintext image, and then the error dispersion value e x, y is substituted into an error filtering technique for filtering processing, so that the filtering result is added to the plaintext image to perform a multi-level critical value (t i ) Quantization process to get the next multi-level plaintext image, and then repeat the above steps until the last multi-level plaintext image is obtained.

於一種具體實施例中,該密本產生技術所產生第一個密本影像係為在Z p 場的p階多值影像所隨機產生,並將自定加法與乘法模運算過後的第一個密本影像為第二個密本影像,再求第二個密本影像的反元素與明文影像進行模運算產生最後一個密本影像。 In a specific embodiment, the first cipher text image generated by the cipher text generation technique is randomly generated from the p- order multi-value image in the Z p field, and the first one after the self-defined addition and multiplication modulus is calculated. The cipher text image is the second cipher text image, and then the inverse element of the second cipher text image and the plaintext image are modulated to generate the last cipher text image.

該同餘方程式如下所示: The congruence equation is as follows:

Figure 109141857-A0101-12-0005-1
Figure 109141857-A0101-12-0005-1

其中,設S密本影像為一個整數環(Ring)代數結構,而P i 鑰匙與同態密文影像R i 是一個體(Field)的代數結構,並定義加密方法是利用SP i 兩者所形成的同餘方程式為加密的輸出結果,P i 為質數且滿足GCD(P i ,P j )=1。 Wherein, let S densely present image is an integer ring (Ring) algebraic structure, and P i key and the same state ciphertext image R i is an algebraic structure of a body (Field) and defines the encryption method is the use of S and P i two The congruence equation formed by the above is the encrypted output result, and P i is a prime number and satisfies GCD ( P i , P j )=1.

請參看圖8所示的實施例,於視覺加密步驟中,該模乘法與該模加法運算過程係以封包的形式儲存在多階明文影像的密秘位置上。 Please refer to the embodiment shown in FIG. 8. In the visual encryption step, the modular multiplication and the modular addition operations are stored in the secret location of the multi-level plaintext image in the form of packets.

本發明應用上述同態多階視覺影像加密方法於疊加影像的實施例,係該多階影像產生步驟中,該至少一個灰階明文影像包括一第一灰階明文影像及一第二灰階明文影像,並分別經過量化處理後獲得用以相疊加為一顯示圖像的一第一多階明文影像及一第二多階明文影像;該視覺加密步驟中,分別將該第一多階明文影像及該第二多階明文影像分別透過該密本產生技術計算而得到複數第一密本影像及複數第二密本影像,將該複數第一密本影像及該複數第二密本影像分別進行一視覺加密程序,該視覺加密程序係使該複數第一密本影像及該複數第二密本影像須分別相對應地進行模運算相加及模運算相乘而可獲得該第一多階明文影像及該第二多階明文影像;該同態加密步驟中,分別將該複數第一密本影像及該複數第二密本影像分別利用一第一組鑰匙及一第二組鑰匙所形成的同餘方程式依序進行同態加密,以分別獲得複數第一同態密文影像及複數第二同態密文影像,使該複數第一同態密文影像及該複數第二同態密文影像供以中國餘式定理對其進行解密而獲得解密的該複數第一密本影像及該複數第一 密本影像;其中,經授權僅能分享到該第一多階明文影像的一第一使用者,則僅能與於該顯示圖像中看到該第一多階明文影像;而經授權分享到該第一多階明文影像及該第二多階明文影像的一第二使用者,則能與於該顯示圖像中同時看到相疊加的該第一多階明文影像及該第二多階明文影像。 The present invention applies the above-mentioned homomorphic multi-level visual image encryption method to an embodiment of superimposed images. In the multi-level image generation step, the at least one gray-level plaintext image includes a first gray-level plaintext image and a second gray-level plaintext image. The first multi-level plaintext image and the second multi-level plaintext image that are superimposed into a display image are obtained after quantization processing respectively; in the visual encryption step, the first multi-level plaintext image is respectively obtained And the second multi-level plaintext image are calculated through the cipher generation technology to obtain a plurality of first cipher images and a plurality of second cipher images, and the plurality of first cipher images and the plural second cipher images are respectively A visual encryption process, the visual encryption process makes the plural first cipher image and the plural second cipher image correspondingly perform modular operation addition and modular operation multiplication to obtain the first multi-level plaintext Image and the second multi-level plaintext image; in the homomorphic encryption step, the plural first cipher images and the plural second cipher images are respectively formed by using a first set of keys and a second set of keys The congruence equations sequentially perform homomorphic encryption to obtain plural first homomorphic ciphertext images and plural second homomorphic ciphertext images respectively, so that the plural first homomorphic ciphertext images and the plural second homomorphic ciphertext images are obtained The image is decrypted by the Chinese remainder theorem to obtain the decrypted plural first cipher image and the plural first Cipher image; among them, a first user who is authorized to only share the first multi-level plaintext image can only be able to see the first multi-level plaintext image in the displayed image; and authorized to share A second user who reaches the first multi-level plaintext image and the second multi-level plaintext image can simultaneously see the superimposed first multi-level plaintext image and the second multi-level plaintext image in the displayed image. Level plaintext image.

本發明的一種應用實施例中,係包括一伺服器端單元(如伺服器)及至少一終端單元(如電腦),該伺服器端單元與終端單元係透過一通訊網路訊號連結,該多階影像產生步驟、視覺加密步驟及同態解密步驟係於終端單元執行,該同態加密步驟係於伺服器端單元執行。 In an application embodiment of the present invention, it includes a server-side unit (such as a server) and at least one terminal unit (such as a computer). The server-side unit and the terminal unit are connected through a communication network signal, and the multi-level The image generation step, the visual encryption step, and the homomorphic decryption step are executed in the terminal unit, and the homomorphic encryption step is executed in the server end unit.

本發明提出一個運用於多階影像(Multi-tone image)的視覺加密方式,其特性不但可以具有密秘分享的功能還具有利用同態密碼對密秘分享的結果進一步加密的雙重保障。另外,結果視覺加密與同態加密的方法還可以把密秘分享的優先順序進行排序,讓密秘的等級得以實現。本發明利用具有密文可運算特性的同態加密方法進行密本的加密,使其具有保密功能還可以進行模加法與乘法運算。如此使用視覺加密下同態加密的結合方法運算在多值影像上我們稱之為同態多值影像視覺加密,此外,本發明除上述功能外還增加視覺加密的產生方法可利用加法與乘法模運算進行產生密本的功能。 The present invention proposes a visual encryption method applied to multi-tone images, which not only has the function of secret sharing, but also has the double guarantee of further encrypting the result of secret sharing by using a homomorphic cipher. In addition, the resultant visual encryption and homomorphic encryption methods can also sort the priority of secret sharing, so that the level of secrets can be achieved. The present invention uses a homomorphic encryption method with ciphertext operable characteristics to encrypt the ciphertext, so that it has a confidential function and can perform modular addition and multiplication operations. In this way, using the combined method of homomorphic encryption under visual encryption to operate on multi-valued images is called homomorphic multi-valued image visual encryption. In addition, in addition to the above functions, the present invention also adds visual encryption generation methods that can use addition and multiplication modes. The function of calculating the secret book.

一般而言,錯誤分散(Error diffusion)法建構二階影像已被提出,在此,本發明係改良傳統的二階錯誤分散法形成多階(multiple-tone)影像產生方式如下:設g x,y h x,y 是灰階影像與多階影像表示,而h x,y 是由g x,y 經過量化後所得的多階影像。量化誤差e x,y 表示成e x,y =g x,y -h x,y 。多階區域h x,y 被分割成如下式: Generally speaking, the error diffusion method to construct a second-order image has been proposed. Here, the present invention improves the traditional second-order error diffusion method to form a multiple-tone image generation method as follows: Let g x, y and h x, y is a gray-scale image and a multi-level image representation, and h x, y is a multi-level image obtained by quantizing g x, y. The quantization error e x,y is expressed as e x,y = g x,y - h x,y . The multi-level area h x, y is divided into the following formula:

Figure 109141857-A0101-12-0007-2
Figure 109141857-A0101-12-0007-2

上述的多階影像臨界值是產生出與原灰階影像的錯誤分散值e x,y 。本發明將上述多階影像產生方式由圖1來表示,具體的,圖1中的錯誤濾波區塊是利用以下濾波方式進行: The above-mentioned multi-level image critical value is the error dispersion value e x,y generated from the original gray-level image. The present invention shows the above-mentioned multi-level image generation method as shown in FIG. 1. Specifically, the error filtering block in FIG. 1 is performed by the following filtering method:

g x,y+1=g x,y+1+(7/16)×e x,y g x,y +1 = g x,y +1 +(7/16)× e x,y

g x+1,y =g x+1,y +(5/16)×e x,y g x +1, y = g x +1, y +(5/16)× e x,y

g x+1,y-1=g x+1,y-1+(3/16)×e x,y g x +1, y -1 = g x +1, y -1 +(3/16)× e x,y

g x+1,y+1=g x+1,y+1+(1/16)×e x,y g x +1, y +1 = g x +1, y +1 +(1/16)× e x,y

圖2所示為3階影像的產生圖形方式示意。至於上述方式可產生任意n階影像,但是在本發明中其中n=pp為質數。實際產生多階影像時我們是利用多階數值索引方式進行,如目前有一三階影像的臨界值為{t 1=0,t 2=127,t 3=255}實際表示在影像中的索引值為: Figure 2 shows a schematic diagram of the 3-level image generation pattern. As for the above method, any n- order image can be generated, but in the present invention, n = p and p is a prime number. When actually generating multi-level images, we use multi-level numerical indexing. For example, the current critical value of a third-level image is { t 1 =0, t 2 =127, t 3 =255} which actually represents the index in the image The value is:

t 1→1 t 1 →1

t 2→2 t 2 →2

t 3→3 t 3 →3

再者,視覺加密方式是由多個密本進行結合產生一個明文的加密方式如圖3所示,在圖3的實施例中,係為三人密本的視覺加密範例。其中使用者S 1與使用者S 2兩者需先相加後再與使用者S 3相乘即可得明文影像G。視覺加密的一大特點是可以進行密秘分享,假設有三個密本S 1S 2S 3。此三密本需要三者同時進行解密才可以獲得明文G。三個S 1S 2S 3的多階影像密本產生原理是利用一組具有在Z p 模乘法與模加法運算,此組運算可以決定運算的順序並且亦決定反回明文的順序。如圖3範例密文S 1S 2 需先模運算相加再與密本模運算相乘才可能獲得明文G。如有N個密本使用者,其密本產生技術過程如下: Furthermore, the visual encryption method is an encryption method that combines multiple ciphers to generate a plaintext, as shown in FIG. 3. In the embodiment of FIG. 3, it is an example of visual encryption of three ciphers. The user S 1 and the user S 2 need to be added first and then multiplied by the user S 3 to obtain the plaintext image G. A major feature of visual encryption is that it can be secretly shared. Suppose there are three secret books S 1 , S 2 and S 3 . The three ciphers need to be decrypted at the same time to obtain the plaintext G. The principle of generating the multi-level image ciphers of the three S 1 , S 2 and S 3 is to use a set of modular multiplication and modular addition operations in Z p . This set of operations can determine the order of operations and also the order of returning the plaintext. As shown in Figure 3, the ciphertext S 1 and S 2 need to be added by modulo operation and then multiplied by the modulo operation of the cipher text to obtain the plaintext G. If there are N cipher book users, the technical process of cipher book generation is as follows:

1.產生N-1個在Z p 場的p階多值影像隨機密本(隨機產生)。 1. Generate N-1 random ciphers of p- order multi-value images in the Z p field (randomly generated).

2將N-2個自定加法與乘法模運算過後的N-1個密文為W,再求W的 反元素與明文進行模運算產生最後的第N個密文影像。 2 Turn the N-1 ciphertexts after N-2 self-defined addition and multiplication modulus operations into W, and then find the value of W The inverse element and the plaintext are modulo arithmetic to produce the final Nth ciphertext image.

此外,同態加密本身具有密文可運算性的特質,因此本發明利用視覺加密的效果配合上同態加密運用在多階影像上,我們稱之為同態多階影像視覺加密。同態多階影像視覺加密具密秘分享及密文可運算等性質。以上兩特性可使經由視覺加密後的多階影像可以進行模乘法與模加法運算後可得一個視覺加密後的密文H,此密文可以經由同態解密將密文H反回明文G,此編碼過程如圖4所示,利用此特性可以應用在雲端運算服務與權利分享…等場合。以下將介紹同態函數的特性: In addition, homomorphic encryption itself has the characteristic of ciphertext operability, so the present invention utilizes the effect of visual encryption and the homomorphic encryption is applied to multi-level images, which we call homomorphic multi-level image visual encryption. The homomorphic multi-level image visual encryption has the properties of secret sharing and ciphertext operation. After the above two multi-order feature allows the visual image can be encrypted via a modulo multiplication and modulo addition operation can be obtained after a visual encrypted ciphertext H, can decrypt this ciphertext to the ciphertext back to the plaintext H G via inverse homomorphic, This encoding process is shown in Figure 4. Using this feature, it can be applied to cloud computing services and rights sharing... and other occasions. The following will introduce the characteristics of homomorphic functions:

Figure 109141857-A0101-12-0008-3
Figure 109141857-A0101-12-0008-3

一個常見的同態函數為模運算,如圖5所示。設S為一個整數環(Ring)代數結構,而P i R i 是一個體(Field)的代數結構,我們定義加密方法是利用MP i 兩者所形成的同餘方程式為加密的輸出結果,下面方程為同餘方程式: A common homomorphic function is modular operation, as shown in Figure 5. Let S is an integer ring (Ring) algebraic structure, and P i and R i is an algebraic structure body (Field), we define the congruence equation encryption method using both M and P i formed is encrypted output As a result, the following equation is a congruence equation:

Figure 109141857-A0101-12-0008-4
Figure 109141857-A0101-12-0008-4

其中明文S為輸入,經一組鑰匙{P 1,P 2,L,P l }獲得輸出 r=[r 1 r 2 L r l ]'密文。因此加密步驟如下所示: The plaintext S is the input, and the output r = [ r 1 r 2 L r l ]'ciphertext is obtained through a set of keys {P 1 , P 2 , L, P l }. Therefore, the encryption steps are as follows:

1、將影像轉換成多值影像並使用視覺加密產生出欲加密之密本S1. Convert the image into a multi-value image and use visual encryption to generate the encrypted copy S.

2、利用{P 1,P 2,L,P l }與S產生r=[r 1 r 2 L r l ]'。 2. Use { P 1 , P 2 ,L, P l } and S to generate r =[ r 1 r 2 L r l ]'.

當伺服器端單元進行終端單元的資料運算服務後,再把運算完後的加密資料回傳給終端單元(即客戶端)後,客戶端再將解密流程分為以下幾個步驟進行,亦即,當密秘分享端欲進行明文回覆時,其解密流程分為以下幾個步驟進行: When the server-side unit performs the data computing service of the terminal unit, and then returns the encrypted data after the operation to the terminal unit (ie, the client), the client then divides the decryption process into the following steps, namely When the secret sharing terminal wants to reply in plaintext, its decryption process is divided into the following steps:

(a)密鑰乘積總和為Q=P 1 P 2L P l (a) The sum of key products is Q=P 1 P 2 L P l ;

(b)不包含Pi之乘積總合為Q i =Q/P i (b) does not comprise the product of the sum of P i Q i = Q / P i;

(c)Q i 之反元素為I i =[Q i ]-1 mod P i (c) The opposite element of Q i is I i =[ Q i ] -1 mod P i ;

(d)最後之輸出為

Figure 109141857-A0101-12-0009-5
。 (d) The final output is
Figure 109141857-A0101-12-0009-5
.

上述過程如圖7所示。最後,本發明是由第一階段視覺加密結合第二階段同態加密所生成的加密效果。在第一階段視覺加密本發明的一個特點是可以進行模加法與模乘法運算,因此其運算過程需要告訴欲密秘分享的參與者才可以獲得密秘分享者合成後的密本。這一個模加法與模乘法的運算過程會以封包的形式存在多值影像的密秘位置上,其封包格式如圖8所示,至於封包表頭為後序的運算產生方法其表示如圖9所示。 The above process is shown in Figure 7. Finally, the present invention is the encryption effect generated by the first-stage visual encryption combined with the second-stage homomorphic encryption. In the first stage of visual encryption, a feature of the present invention is that it can perform modular addition and modular multiplication operations. Therefore, the calculation process needs to inform the participants who want to secretly share to obtain the secret copy synthesized by the secret sharer. The calculation process of this modular addition and modular multiplication will be stored in the secret location of the multi-value image in the form of a packet. The packet format is shown in Figure 8. As for the method of generating the packet header as a post-order operation, it is shown in Figure 9. Shown.

其次,上述為提出的同態加密加、解密原理。但是在實務上還需要考慮到鑰匙分配與選擇的問題,另外還有當欲伺服器端單元進行運算的演算法如何使伺服器端單元知曉的問題,以下則針對這三個問題進行說明。解一個大的任意階數佈於F q 的多項式: Secondly, the above is the proposed principle of homomorphic encryption and decryption. However, in practice, the key distribution and selection issues need to be considered. In addition, there is also the issue of how to make the server-end unit aware of the calculation algorithm of the server-end unit. These three issues are explained below. Solve a large polynomial of any order over F q:

N(x)=P 1(x)P 2(x)L P k (x) N ( x ) = P 1 ( x ) P 2 ( x ) L P k ( x )

其中k

Figure 109141857-A0101-12-0010-19
n。其中上述多項式彼此兩兩GCD(P i (x),P j (x))=1。上述將N(x)分解成k個原式多項式。現在如果選擇鑰匙數目為n=2,3,L,k,我們可以提供
Figure 109141857-A0101-12-0010-21
把鑰匙。 Where k
Figure 109141857-A0101-12-0010-19
n . Among them, the above polynomials are paired with each other GCD ( P i ( x ) , P j ( x ))=1. The above decomposes N ( x ) into k primitive polynomials. Now if the number of keys is selected as n = 2, 3, L, k , we can provide
Figure 109141857-A0101-12-0010-21
Put the key.

上述(1)只是提供了同態密碼的鑰匙個數,但是並非所有鑰匙都是適合使用的,原因是實際上的明文資料有可能無法讓鑰匙進行模運算,使得其本身的明文無法被加密成密文的問題。這個問題可以利用適當的選擇鑰匙改善這個問題。因此我們將k把鑰匙將其階數由小排到大如下: The above (1) only provides the number of keys for the homomorphic password, but not all keys are suitable for use. The reason is that the actual plaintext data may not allow the key to perform modular operations, making its own plaintext unable to be encrypted into The issue of ciphertext. This problem can be improved by using the appropriate selection key. Therefore, we rank k keys from small to large as follows:

deg(P 1(x))>deg(P 2(x))>L>deg(P k (x)) deg( P 1 ( x ))>deg( P 2 ( x ))>L>deg( P k ( x ))

鑰題的選擇本發明選擇一個大階數的鑰匙配合一個小階數的鑰匙成對的配對方式選擇,這樣子可以改善小明文無法被加密的缺點,因此上述之鑰匙設計為如下: The selection of key questions The present invention selects a pair of keys with a large order and a key with a small order, which can improve the shortcomings that the small plaintext cannot be encrypted. Therefore, the above-mentioned key is designed as follows:

Figure 109141857-A0101-12-0010-6
Figure 109141857-A0101-12-0010-6

以上所述,僅為本發明之可行實施例,並非用以限定本發明之專利範圍,凡舉依據下列請求項所述之內容、特徵以及其精神而為之其他變化的等效實施,皆應包含於本發明之專利範圍內。本發明所具體界定於請求項之結構特徵,未見於同類物品,且具實用性與進步性,已符合發明專利要件,爰依法具文提出申請,謹請 鈞局依法核予專利,以維護本申請人合法之權益。 The above are only feasible embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent implementation of other changes based on the content, characteristics and spirit of the following claims shall be It is included in the scope of the patent of the present invention. The structural features of the invention specifically defined in the claim are not found in similar articles, and are practical and progressive. They have already met the requirements of a patent for invention. The application is filed in accordance with the law. I would like to request that the Bureau of Junction approve the patent in accordance with the law to protect this The legitimate rights and interests of the applicant.

Claims (8)

一種同態多階視覺影像加密方法,其包括下列步驟:多階影像產生步驟,將至少一個灰階明文影像經過量化處理後獲得至少一個多階明文影像;視覺加密步驟,將該至少一個多階明文影像透過一密本產生技術計算而得到複數密本影像,將該複數密本影像進行一視覺加密程序,該視覺加密程序係使該複數密本影像須相對應地進行模運算相加及模運算相乘而可獲得該至少一個多階明文影像;及同態加密步驟,分別將該複數密本影像利用至少一組鑰匙(Pi)所形成的同餘方程式依序進行同態加密,以獲得複數同態密文影像,使該複數同態密文影像供以中國餘式定理對其進行解密而獲得解密的該複數密本影像;其中,於該多階影像產生步驟中,該至少一個灰階明文影像係以多階臨界值(ti)進行量化處理而獲得該至少一個多階明文影像,並將該至少一個灰階明文影像減該至少一個多階明文影像而得到錯誤分散值e x,y ,再將該錯誤分散值e x,y 代入一錯誤濾波技術進行濾波處理,將濾波處理結果與該明文影像相加後進行多階臨界值(ti)的量化處理,以得到下一個該多階明文影像,重覆上述步驟,直到得到最後一個該多階明文影像為止。 A homomorphic multi-level visual image encryption method, which includes the following steps: a multi-level image generation step, at least one gray-level plaintext image is quantized to obtain at least one multi-level plaintext image; a visual encryption step, the at least one multi-level plaintext image is obtained The plaintext image is calculated by a cipher copy generation technology to obtain a complex cipher image, and the complex cipher image is subjected to a visual encryption process. The at least one multi-level plaintext image can be obtained by multiplying operations; and the homomorphic encryption step, respectively, using the congruence equations formed by at least one set of keys (P i ) to perform homomorphic encryption in sequence to the complex cipher image, to Obtain a complex homomorphic ciphertext image, and decrypt the complex homomorphic ciphertext image using the Chinese remainder theorem to obtain the decrypted complex ciphertext image; wherein, in the multi-level image generation step, the at least one The gray-scale plaintext image is quantized by a multi-level threshold (t i ) to obtain the at least one multi-level plaintext image, and the at least one gray-level plaintext image is subtracted from the at least one multi-level plaintext image to obtain the error dispersion value e x, y , and then substitute the error dispersion value e x, y into an error filtering technique for filtering processing, adding the filtering processing result to the plaintext image and performing multi-level critical value (t i ) quantization processing to obtain the following Repeat the above steps for a multi-level plaintext image until the last multi-level plaintext image is obtained. 如請求項1所述之同態多階視覺影像加密方法,其中,於該多階影像產生步驟中,該多階影像產生方式係設g x,y h x,y 分別表示為該至少一個灰階影像與該至少一個多階影像,而h x,y 是由g x,y 經過量化後所得的該至少一個多階影像;一量化誤差e x,y 表示成:e x,y =g x,y -h x,y ;至少一個多階影像h x,y 被分割成如下:
Figure 109141857-A0305-02-0015-1
The homomorphic multi-level visual image encryption method according to claim 1, wherein, in the multi-level image generation step, the multi-level image generation method is set g x, y and h x, y as the at least one The gray-scale image and the at least one multi-level image, and h x,y is the at least one multi-level image obtained after g x,y is quantized; a quantization error e x,y is expressed as: e x,y = g x,y - h x,y ; at least one multi-level image h x,y is divided into the following:
Figure 109141857-A0305-02-0015-1
如請求項1所述之同態多階視覺影像加密方法,其中,該密本產生技術係產生第一個該密本影像係為在Z p 場的p階多值影像所隨機產生,並將自定加法與乘法模運算過後的第一個該密本影像為第二個該密本影像,再求第二個該密本影像的反元素與該明文影像進行模運算產生最後一個密本影像。 The homomorphic multi-level visual image encryption method according to claim 1, wherein the cipher generation technology is to generate the first cipher image that is randomly generated by the p- order multi-value image in the Z p field, and The first cipher image after the custom addition and multiplication modulus is the second cipher image, and then the inverse element of the second cipher image and the plaintext image are modulated to produce the last cipher image . 如請求項1所述之同態多階視覺影像加密方法,其中,該同餘方程式如下所示:
Figure 109141857-A0305-02-0015-2
其中,設S密本影像為一個整數環(Ring)代數結構,而P i 鑰匙與同態密文影像R i 是一個體(Field)的代數結構,並定義加密方法是利用SP i 兩者所形成的同餘方程式為加密的輸出結果,P i 為質數且滿足GCD(P i ,P j )=1。
The homomorphic multi-level visual image encryption method described in claim 1, wherein the congruence equation is as follows:
Figure 109141857-A0305-02-0015-2
Wherein, let S densely present image is an integer ring (Ring) algebraic structure, and P i key and the same state ciphertext image R i is an algebraic structure of a body (Field) and defines the encryption method is the use of S and P i two The congruence equation formed by the above is the encrypted output result, and P i is a prime number and satisfies GCD ( P i , P j )=1.
如請求項4所述之同態多階視覺影像加密方法,其中,執行該中國餘式定理時包含下列的解密步驟:(a)密鑰乘積總和為Q=P 1 P 2L P l ;(b)不包含Pi之乘積總合為Q i =Q/P i ; (c)Q i 之反元素為I i =[Q i ]-1 mod P i ;及(d)最後之輸出為
Figure 109141857-A0305-02-0016-3
The homomorphic multi-level visual image encryption method described in claim 4, wherein the following decryption steps are included when the Chinese remainder theorem is executed: (a) The sum of key products is Q = P 1 P 2 L P l ; b) does not comprise the product of the sum of P i Q i = Q / P i; counter-element (c) Q i is the I i = [Q i] -1 mod P i; and (d) the output of the last
Figure 109141857-A0305-02-0016-3
.
如請求項1所述之同態多階視覺影像加密方法,其中,於該視覺加密步驟中,該模運算相加及該模運算相乘運算過程係以封包的形式儲存在該多階明文影像的密秘位置上。 The homomorphic multi-level visual image encryption method according to claim 1, wherein, in the visual encryption step, the modular operation addition and the modular operation multiplication operation process are stored in the multi-level plaintext image in the form of a packet In the secret location. 如請求項1所述之同態多階視覺影像加密方法,其中,更包括提供一伺服器端單元、至少一終端單元及通訊網路;該伺服器端單元與該至少一終端單元係透過該通訊網路訊號連結,該多階影像產生步驟、該視覺加密步驟及該同態解密步驟係於該至少一終端單元執行,該同態加密步驟係於該伺服器端單元執行。 The homomorphic multi-level visual image encryption method according to claim 1, which further includes providing a server-end unit, at least one terminal unit, and a communication network; the server-end unit and the at least one terminal unit pass through the communication network The multi-level image generation step, the visual encryption step, and the homomorphic decryption step are executed in the at least one terminal unit, and the homomorphic encryption step is executed in the server-end unit. 如請求項1所述之同態多階視覺影像加密方法,其中,該多階影像產生步驟中,該至少一個灰階明文影像包括一第一灰階明文影像及一第二灰階明文影像,並分別經過量化處理後獲得用以相疊加為一顯示圖像的一第一多階明文影像及一第二多階明文影像;該視覺加密步驟中,分別將該第一多階明文影像及該第二多階明文影像分別透過該密本產生技術計算而得到複數第一密本影像及複數第二密本影像,將該複數第一密本影像及該複數第二密本影像分別進行一視覺加密程序,該視覺加密程序係使該複數第一密本影像及該複數第二密本影像須分別相對應地進行模運算相加及模運算相乘而可獲得該第一多階明文影像及該第二多階明文影像;該同態加密步驟中,分別將該複數第一密本影像及該複數第二密本影像分別利用一第一組鑰匙及一第二組鑰匙所形成的同餘方程式依序進行同態加密,以分別獲得複數第一同態密文影像及複數第二同態密文影像,使該複數第一 同態密文影像及該複數第二同態密文影像供以中國餘式定理對其進行解密而獲得解密的該複數第一密本影像及該複數第一密本影像;其中,經授權僅能分享到該第一多階明文影像的一第一使用者,則僅能與於該顯示圖像中看到該第一多階明文影像;而經授權分享到該第一多階明文影像及該第二多階明文影像的一第二使用者,則能與於該顯示圖像中同時看到相疊加的該第一多階明文影像及該第二多階明文影像。 The homomorphic multi-level visual image encryption method according to claim 1, wherein, in the multi-level image generation step, the at least one gray-scale plaintext image includes a first gray-scale plaintext image and a second gray-scale plaintext image, After quantization processing, a first multi-level plaintext image and a second multi-level plaintext image that are superimposed into a display image are obtained; in the visual encryption step, the first multi-level plaintext image and the The second multi-level plaintext image is calculated through the cipher text generation technology to obtain a plurality of first cipher text images and a plurality of second cipher text images, and the plurality of first cipher text images and the plurality of second cipher text images are visualized separately Encryption process, the visual encryption process is to make the plural first cipher image and the plural second cipher image need to perform modular operation addition and modular operation multiplication respectively to obtain the first multi-level plaintext image and The second multi-level plaintext image; in the homomorphic encryption step, the plural first cipher images and the plural second cipher images are respectively used to form congruences formed by a first set of keys and a second set of keys The equations are homomorphically encrypted in sequence to obtain plural first homomorphic ciphertext images and plural second homomorphic ciphertext images respectively, so that the plural first homomorphic ciphertext images are obtained. The homomorphic ciphertext image and the plural second homomorphic ciphertext image are decrypted by the Chinese remainder theorem to obtain the plural first ciphertext image and the plural first ciphertext image; among them, only authorized A first user who can share the first multi-level plaintext image can only share the first multi-level plaintext image in the displayed image; and is authorized to share the first multi-level plaintext image and A second user of the second multilevel plaintext image can simultaneously see the superimposed first multilevel plaintext image and the second multilevel plaintext image in the display image.
TW109141857A 2020-11-27 2020-11-27 Homomorphic multi-level visual image encryption system and method and its application TWI746296B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW109141857A TWI746296B (en) 2020-11-27 2020-11-27 Homomorphic multi-level visual image encryption system and method and its application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW109141857A TWI746296B (en) 2020-11-27 2020-11-27 Homomorphic multi-level visual image encryption system and method and its application

Publications (2)

Publication Number Publication Date
TWI746296B true TWI746296B (en) 2021-11-11
TW202221543A TW202221543A (en) 2022-06-01

Family

ID=79907673

Family Applications (1)

Application Number Title Priority Date Filing Date
TW109141857A TWI746296B (en) 2020-11-27 2020-11-27 Homomorphic multi-level visual image encryption system and method and its application

Country Status (1)

Country Link
TW (1) TWI746296B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI823592B (en) * 2022-09-30 2023-11-21 中華電信股份有限公司 System and method for performing encrypted mixing based on big number format and additive homomorphism

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200926758A (en) * 2007-12-13 2009-06-16 Altek Corp Image processing system with image encryption function and method thereof
TW201227597A (en) * 2010-12-17 2012-07-01 Univ Nat Taiwan Science Tech A multiple regions visual cryptography method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW200926758A (en) * 2007-12-13 2009-06-16 Altek Corp Image processing system with image encryption function and method thereof
TW201227597A (en) * 2010-12-17 2012-07-01 Univ Nat Taiwan Science Tech A multiple regions visual cryptography method

Also Published As

Publication number Publication date
TW202221543A (en) 2022-06-01

Similar Documents

Publication Publication Date Title
Mondal et al. A light weight secure image encryption scheme based on chaos & DNA computing
Wu et al. Color image encryption based on chaotic systems and elliptic curve ElGamal scheme
WO2022237450A1 (en) Secure multi-party computation method and apparatus, and device and storage medium
Abdo et al. A cryptosystem based on elementary cellular automata
CN111510281B (en) Homomorphic encryption method and device
Almaiah et al. A new hybrid text encryption approach over mobile ad hoc network
CN108388808B (en) Image encryption method based on Xi Er encryption and dynamic DNA encoding
Bigdeli et al. A novel image encryption/decryption scheme based on chaotic neural networks
Kumar et al. IEHC: An efficient image encryption technique using hybrid chaotic map
EP1081889A2 (en) Extended key generator, encryption / decryption unit, extended key generation method, and storage medium
CN112134688A (en) Asymmetric image encryption method based on quantum chaotic mapping and SHA-3
JP4869824B2 (en) Receiver device, sender device, cryptographic communication system, and program
TW202002564A (en) Data encryption and decryption method and device
Liang et al. An image encryption algorithm based on Fibonacci Q-matrix and genetic algorithm
El-Zoghabi et al. Survey report on cryptography based on neural network
CN112668046A (en) Feature interleaving method, apparatus, computer-readable storage medium, and program product
Gabr et al. A combination of decimal-and bit-level secure multimedia transmission
CN112769542A (en) Multiplication triple generation method, device, equipment and medium based on elliptic curve
Singh et al. Image encryption scheme based on Knight's tour problem
TWI746296B (en) Homomorphic multi-level visual image encryption system and method and its application
Manikandan et al. On dual encryption with RC6 and combined logistic tent map for grayscale and DICOM
Kumar et al. Overview of information security using genetic algorithm and chaos
Sadkhan et al. Security Evaluation of Cryptosystems based on Orthogonal Transformation
Rim et al. An improved partial image encryption scheme based on lifting wavelet transform, wide range Beta chaotic map and Latin square
Mir et al. A public and private key image encryption by modified approach of Vigener cipher and the chaotic maps