TWI835580B - Multiple terminal end-to-end encryption communication method and computer readable medium - Google Patents
Multiple terminal end-to-end encryption communication method and computer readable medium Download PDFInfo
- Publication number
- TWI835580B TWI835580B TW112108749A TW112108749A TWI835580B TW I835580 B TWI835580 B TW I835580B TW 112108749 A TW112108749 A TW 112108749A TW 112108749 A TW112108749 A TW 112108749A TW I835580 B TWI835580 B TW I835580B
- Authority
- TW
- Taiwan
- Prior art keywords
- key
- terminal
- message
- account
- receiving
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 107
- 238000004891 communication Methods 0.000 title claims abstract description 63
- 238000004422 calculation algorithm Methods 0.000 claims description 20
- 238000010586 diagram Methods 0.000 description 14
- 238000005516 engineering process Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 4
- 230000008859 change Effects 0.000 description 4
- 238000009795 derivation Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- PCHJSUWPFVWCPO-UHFFFAOYSA-N gold Chemical compound [Au] PCHJSUWPFVWCPO-UHFFFAOYSA-N 0.000 description 2
- 239000010931 gold Substances 0.000 description 2
- 229910052737 gold Inorganic materials 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 1
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Landscapes
- Computer And Data Communications (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
Description
本發明係關於一種多終端之端對端加密通訊技術(通訊訊息加密技術),特別是指一種多終端之端對端加密通訊方法及電腦可讀媒介。 The present invention relates to a multi-terminal end-to-end encrypted communication technology (communication message encryption technology), and in particular to a multi-terminal end-to-end encrypted communication method and computer-readable medium.
現行常見的多終端之端對端加密通訊方法(如即時通訊訊息加密方法)中,大多可分為下列兩類技術。 Most of the current common multi-terminal end-to-end encrypted communication methods (such as instant messaging message encryption methods) can be divided into the following two types of technologies.
第一類技術:發訊終端對每個收訊終端進行獨立的一對一加密通訊,因各終端間之訊息皆為獨立加密,故隨著終端之數量成長,會增加伺服器與終端之運算量及通訊量。 The first type of technology: the sending terminal conducts independent one-to-one encrypted communication with each receiving terminal. Since the messages between each terminal are independently encrypted, as the number of terminals grows, the calculations of the server and terminal will increase. volume and communication volume.
第二類技術:發訊終端隨機產生一組金鑰,將此金鑰透過端對端加密同步至所有收訊終端,且各終端利用金鑰衍生函式(Key Derivation Function;KDF)將金鑰衍生為後續訊息之加解密所使用之訊息金鑰。惟,此第二類技術需將金鑰加密後上傳至伺服器,且在同步金鑰時仍會受到終端之數量影響。 The second type of technology: the sending terminal randomly generates a set of keys, synchronizes this key to all receiving terminals through end-to-end encryption, and each terminal uses the key derivation function (KDF) to convert the key Derived into the message key used for encryption and decryption of subsequent messages. However, this second type of technology requires the key to be encrypted and then uploaded to the server, and the key synchronization will still be affected by the number of terminals.
再者,目前主流的即時通訊服務商在上述第一類技術與第二類 技術中提出一些方法,但仍會因終端之數量而對效能產生影響,並沒有一個能兼具效能、安全性與可用性之解決方案,而仍存在許多的改善空間。 Furthermore, the current mainstream instant messaging service providers use the above-mentioned first type of technology and the second type There are some methods proposed in the technology, but the number of terminals will still affect the performance. There is no solution that can combine performance, security and usability, and there is still a lot of room for improvement.
因此,如何提供一種創新之多終端之端對端加密通訊技術或通訊訊息加密技術,以解決上述之任一問題或提供相關之方法,已成為本領域技術人員之一大研究課題。 Therefore, how to provide an innovative multi-terminal end-to-end encrypted communication technology or communication message encryption technology to solve any of the above problems or provide related methods has become a major research topic for those skilled in the art.
本發明之多終端之端對端加密通訊方法包括:由發訊終端對收訊帳號產生一具有臨時公鑰與臨時私鑰之臨時金鑰對,再由發訊終端將收訊帳號之帳號公鑰與臨時金鑰對之臨時私鑰進行運算以產生對收訊帳號之棘輪金鑰(ratchet key);由發訊終端使用對收訊帳號之棘輪金鑰衍生出訊息金鑰,再由發訊終端使用對收訊帳號之棘輪金鑰所衍生出之訊息金鑰將訊息加密以產生訊息密文,俾由發訊終端將訊息密文與金鑰資訊上傳至伺服器;以及由伺服器將訊息密文與金鑰資訊發送至收訊帳號下之多個收訊終端,以於各收訊終端收到訊息密文時,由各收訊終端使用伺服器所發送之金鑰資訊產生對應棘輪金鑰之訊息金鑰,俾由各收訊終端使用對應棘輪金鑰之訊息金鑰從訊息密文中解密出訊息。 The multi-terminal end-to-end encrypted communication method of the present invention includes: the sending terminal generates a temporary key pair with a temporary public key and a temporary private key for the receiving account, and then the sending terminal publicizes the account number of the receiving account. The key and the temporary private key of the temporary key pair are calculated to generate a ratchet key for the receiving account; the sending terminal uses the ratchet key for the receiving account to derive the message key, and then the sending terminal The terminal uses the message key derived from the ratchet key of the receiving account to encrypt the message to generate the message ciphertext, so that the sending terminal uploads the message ciphertext and key information to the server; and the server transmits the message The ciphertext and key information are sent to multiple receiving terminals under the receiving account, so that when each receiving terminal receives the message ciphertext, each receiving terminal uses the key information sent by the server to generate the corresponding ratchet gold The message key of the key allows each receiving terminal to use the message key corresponding to the ratchet key to decrypt the message from the message ciphertext.
本發明之電腦可讀媒介應用於計算裝置或電腦中,係儲存有指令,以執行上述之多終端之端對端加密通訊方法。 The computer-readable medium of the present invention is used in a computing device or computer and stores instructions to execute the above-mentioned end-to-end encrypted communication method for multiple terminals.
因此,本發明提供一種創新之多終端之端對端加密通訊方法及電腦可讀媒介,係能於使用者擁有多個終端(如發訊終端/收訊終端)時,讓使用者可以同時使用多個終端發送與接收訊息密文(加密訊息),且各終端間之訊 息可以保持一致。亦即,本發明能使各終端間具有訊息之一致性,以利使用者使用任一終端發送或接收一則訊息時,使用者之其餘終端能自動同步此則訊息。 Therefore, the present invention provides an innovative multi-terminal end-to-end encrypted communication method and computer-readable medium, which allows the user to use multiple terminals (such as a sending terminal/receiving terminal) at the same time. Multiple terminals send and receive message ciphertext (encrypted messages), and the communication between terminals Information can remain consistent. That is to say, the present invention can achieve message consistency between terminals, so that when a user uses any terminal to send or receive a message, the user's other terminals can automatically synchronize the message.
再者,本發明能利用棘輪金鑰(棘輪方式)產生訊息金鑰,以利確保訊息或訊息金鑰之前向安全或前向保密(Forward Secrecy;FS)。或者,本發明能於終端(如發訊終端)發送訊息時,終端與收訊帳號之帳號公鑰進行金鑰交換,隨後使用棘輪金鑰衍生出訊息金鑰以進行訊息之加密,此訊息便能被收訊帳號之多個終端解密,有利於達到終端對帳號之端對端加密,且終端所傳送之訊息密文之數量不會受到使用者之終端之數量增加而增加。 Furthermore, the present invention can use a ratchet key (ratchet method) to generate a message key to ensure forward security or forward secrecy (FS) of the message or message key. Or, when the terminal (such as the sending terminal) sends a message, the present invention can perform key exchange with the account public key of the receiving account, and then use the ratchet key to derive the message key to encrypt the message. It can be decrypted by multiple terminals of the receiving account, which is conducive to end-to-end encryption of the terminal account, and the number of message ciphertext sent by the terminal will not increase as the number of user terminals increases.
此外,本發明另揭露一多終端之端對端加密通訊系統包括:發訊終端、收訊終端及伺服器,其中,由發訊終端對收訊帳號產生一具有臨時公鑰與臨時私鑰之臨時金鑰對,再由發訊終端將收訊帳號之帳號公鑰與臨時金鑰對之臨時私鑰進行運算以產生對收訊帳號之棘輪金鑰;由發訊終端使用對收訊帳號之棘輪金鑰衍生出訊息金鑰,再由發訊終端使用對收訊帳號之棘輪金鑰所衍生出之訊息金鑰將訊息加密以產生訊息密文,俾由發訊終端將訊息密文與金鑰資訊上傳至伺服器;以及由伺服器將訊息密文與金鑰資訊發送至收訊帳號下之多個收訊終端,以於各收訊終端收到訊息密文時,由各收訊終端使用伺服器所發送之金鑰資訊產生對應棘輪金鑰之訊息金鑰,俾由各收訊終端使用對應棘輪金鑰之訊息金鑰從訊息密文中解密出訊息。另外,該系統係執行本發明之多終端之端對端加密通訊方法,以提高整體效能、安全性與可用性。 In addition, the present invention also discloses a multi-terminal end-to-end encrypted communication system including: a sending terminal, a receiving terminal and a server, wherein the sending terminal generates a temporary public key and a temporary private key for the receiving account. The temporary key pair is then used by the sending terminal to calculate the account public key of the receiving account and the temporary private key of the temporary key pair to generate a ratchet key for the receiving account; the sending terminal uses the ratchet key for the receiving account. The ratchet key derives the message key, and then the sending terminal uses the message key derived from the ratchet key of the receiving account to encrypt the message to generate message ciphertext, so that the sending terminal combines the message ciphertext with the gold Upload the key information to the server; and the server sends the message ciphertext and key information to multiple receiving terminals under the receiving account, so that when each receiving terminal receives the message ciphertext, each receiving terminal The key information sent by the server is used to generate a message key corresponding to the ratchet key, so that each receiving terminal can use the message key corresponding to the ratchet key to decrypt the message from the message ciphertext. In addition, the system implements the multi-terminal end-to-end encrypted communication method of the present invention to improve overall performance, security and usability.
為使本發明之上述特徵與優點能更明顯易懂,下文特舉實施例, 並配合所附圖式作詳細說明。在以下描述內容中將部分闡述本發明之額外特徵及優點,且此等特徵及優點將部分自所述描述內容可得而知,或可藉由對本發明之實踐習得。應理解,前文一般描述與以下詳細描述二者均為例示性及解釋性的,且不欲約束本發明所欲主張之範圍。 In order to make the above-mentioned features and advantages of the present invention more clearly understandable, examples are given below. And provide detailed explanations with the attached drawings. Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not intended to limit the scope of the invention.
a:第一帳號 a: first account
a1,a2:終端 a1,a2: terminal
a3:新終端 a3: New terminal
b:第二帳號 b:Second account
b1,b2:新終端 b1,b2: new terminal
c:伺服器 c:server
P12至P13:程序 P12 to P13: Program
P22至P23:程序 P22 to P23: Program
P31,P34,P36至P37:程序 P31, P34, P36 to P37: Program
P43,P45至P47:程序 P43,P45 to P47: Program
P61至P63:程序 P61 to P63: Program
S11至S14:步驟 S11 to S14: Steps
S21至S22:步驟 S21 to S22: Steps
S31至S38:步驟 S31 to S38: Steps
S41至S48:步驟 S41 to S48: Steps
S51至S59:步驟 S51 to S59: Steps
圖1為本發明之多終端之端對端加密通訊方法中,有關新增終端之流程示意圖。 Figure 1 is a schematic flowchart of adding a terminal in the end-to-end encrypted communication method for multiple terminals of the present invention.
圖2為本發明之多終端之端對端加密通訊方法中,有關帳號金鑰對之初始化之流程示意圖。 FIG. 2 is a schematic flowchart of the initialization of an account key pair in the multi-terminal end-to-end encrypted communication method of the present invention.
圖3為本發明之多終端之端對端加密通訊方法中,有關帳號金鑰對之更新之流程示意圖。 FIG. 3 is a schematic flowchart of updating an account key pair in the multi-terminal end-to-end encrypted communication method of the present invention.
圖4為本發明之多終端之端對端加密通訊方法中,有關移除終端之流程示意圖。 Figure 4 is a schematic diagram of the process of removing a terminal in the multi-terminal end-to-end encrypted communication method of the present invention.
圖5為本發明之多終端之端對端加密通訊方法中,有關收發訊息之流程示意圖。 FIG. 5 is a schematic flow chart of sending and receiving messages in the multi-terminal end-to-end encrypted communication method of the present invention.
圖6為本發明之多終端之端對端加密通訊方法中,有關金鑰衍生方法之示意圖。 FIG. 6 is a schematic diagram of the key derivation method in the multi-terminal end-to-end encrypted communication method of the present invention.
圖7為本發明之多終端之端對端加密通訊方法中,有關圖1所示新增終端之實施例示意圖。 FIG. 7 is a schematic diagram of an embodiment of the newly added terminal shown in FIG. 1 in the multi-terminal end-to-end encrypted communication method of the present invention.
圖8為本發明之多終端之端對端加密通訊方法中,有關圖2所示帳號金鑰對之初始化之實施例示意圖。 FIG. 8 is a schematic diagram of an embodiment of the initialization of the account key pair shown in FIG. 2 in the multi-terminal end-to-end encrypted communication method of the present invention.
圖9為本發明之多終端之端對端加密通訊方法中,有關圖3所示帳號金鑰對之更新之實施例示意圖。 FIG. 9 is a schematic diagram of an embodiment of updating the account key pair shown in FIG. 3 in the multi-terminal end-to-end encrypted communication method of the present invention.
圖10為本發明之多終端之端對端加密通訊方法中,有關圖4所示移除終端之實施例示意圖。 FIG10 is a schematic diagram of an implementation example of removing the terminal shown in FIG4 in the end-to-end encrypted communication method of multiple terminals of the present invention.
圖11為本發明之多終端之端對端加密通訊方法中,有關圖5所示收發訊息之實施例示意圖。 FIG. 11 is a schematic diagram of an embodiment of sending and receiving messages shown in FIG. 5 in the multi-terminal end-to-end encrypted communication method of the present invention.
以下藉由特定的具體實施形態說明本發明之實施方式,熟悉此技術之人士可由本說明書所揭示之內容瞭解本發明之其他優點與功效,亦可因而藉由其他不同具體等同實施形態加以施行或運用。 The embodiments of the present invention are described below through specific specific embodiments. Persons familiar with the art can understand other advantages and effects of the present invention from the content disclosed in this specification, and can also implement it through other different specific equivalent embodiments or Use.
圖1至圖5分別為本發明之多終端之端對端加密通訊方法中有關新增終端、帳號金鑰對之初始化、帳號金鑰對之更新、移除終端、收發訊息之流程示意圖。 Figures 1 to 5 are respectively flow diagrams of adding a terminal, initializing the account key pair, updating the account key pair, removing the terminal, and sending and receiving messages in the multi-terminal end-to-end encrypted communication method of the present invention.
在一實施例中,本發明所述「至少一」代表一個以上(如一、二或三個以上),「多個」代表二個以上(如二、三、四、五或十個以上)。「終端」可為通訊終端、電子終端、使用者裝置、智慧型手機、平板電腦、個人電腦、筆記型電腦、桌上型電腦等,「新終端」可為新增或新加入之終端,「舊終端」可為舊有或原本之終端。「訊息」可為通訊訊息或即時通訊訊息等,「訊息密文」可為加密訊息等,「發訊」代表發送訊息,「收訊」代表接收訊息。但是,本發明並不以各實施例所提及者為限。 In one embodiment, "at least one" in the present invention represents more than one (such as one, two or more than three), and "plurality" represents more than two (such as two, three, four, five or more than ten). "Terminal" can be a communication terminal, electronic terminal, user device, smart phone, tablet computer, personal computer, notebook computer, desktop computer, etc. "New terminal" can be a new or newly added terminal, " "Old terminal" can be an old or original terminal. "Message" can be a communication message or instant messaging message, etc. "Message ciphertext" can be an encrypted message, etc. "Send message" means sending a message, and "receive" means receiving a message. However, the present invention is not limited to what is mentioned in each embodiment.
本發明之多終端之端對端加密通訊方法亦稱為多終端之端對端 即時通訊加密方法或即時通訊訊息加密方法,並可分為下列所述[1]新增終端、 [2]移除終端、[3]收發訊息等三種實施例。 The multi-terminal end-to-end encrypted communication method of the present invention is also called a multi-terminal end-to-end instant messaging encryption method or an instant messaging message encryption method, and can be divided into the following three embodiments: [1] adding a new terminal, [2] removing a terminal, and [3] sending and receiving messages.
[1]新增終端:如圖1所示,「新增終端」之流程可包括下列步驟S11至步驟S14。亦即,當使用者新增至少一個(如多個)新終端時,新終端可將公鑰(如終端公鑰)上傳至伺服器,後續再進行帳號金鑰對之新增或更新。 [1] Add terminal: As shown in Figure 1, the process of "adding terminal" may include the following steps S11 to step S14. That is, when the user adds at least one (eg, multiple) new terminals, the new terminal can upload the public key (eg, terminal public key) to the server, and then add or update the account key pair later.
步驟S11:新終端透過橢圓曲線密碼學(Elliptic Curve Cryptography;ECC)之方式產生一公私鑰對,為避免後續說明混淆,將此公私鑰對命名為終端金鑰對,且此終端金鑰對可具有終端公鑰與終端私鑰。 Step S11: The new terminal generates a public and private key pair through Elliptic Curve Cryptography (ECC). In order to avoid confusion in subsequent explanations, this public and private key pair is named a terminal key pair, and this terminal key pair can Has the terminal public key and terminal private key.
步驟S12:新終端上傳終端金鑰對之終端公鑰至伺服器。 Step S12: The new terminal uploads the terminal public key of the terminal key pair to the server.
步驟S13:伺服器將使用者目前之帳號下之有效終端資訊列表回傳給新終端。 Step S13: The server returns the valid terminal information list under the user's current account to the new terminal.
步驟S14:新終端依據有效終端資訊列表判斷應進行帳號金鑰對之初始化或更新。例如,若有效終端資訊列表只記錄有新終端(即新增的終端)之資訊,則新終端進行帳號金鑰對之初始化(見圖2);反之,若有效終端資訊列表不只記錄有新終端(即新增的終端)之資訊,還記錄其他終端(舊終端)之資訊,則新終端進行帳號金鑰對之更新(見圖3)。 Step S14: The new terminal determines that the account key pair should be initialized or updated based on the valid terminal information list. For example, if the effective terminal information list only records information about new terminals (that is, newly added terminals), the new terminal will initialize its account key pair (see Figure 2); conversely, if the effective terminal information list does not only record information about new terminals (that is, the newly added terminal) information also records the information of other terminals (old terminals), then the new terminal updates the account key pair (see Figure 3).
[1-1]如圖2所示,「帳號金鑰對之初始化」之流程可包括下列步驟S21至步驟S22。 [1-1] As shown in Figure 2, the process of "initialization of account key pair" may include the following steps S21 to step S22.
步驟S21:新終端透過橢圓曲線密碼學(ECC)之方式產生一公私鑰對。此公私鑰對可命名為帳號金鑰對,且帳號金鑰對可具有帳號公鑰與帳號私鑰。 Step S21: The new terminal generates a public-private key pair through elliptic curve cryptography (ECC). This public and private key pair can be named an account key pair, and the account key pair can have an account public key and an account private key.
步驟S22:新終端上傳帳號金鑰對之帳號公鑰至伺服器中儲存, 即完成帳號金鑰對之初始化。然後,伺服器可依據帳號金鑰對之帳號公鑰回應具有唯一值之帳號公鑰識別碼ID予新終端。 Step S22: The new terminal uploads the account public key of the account key pair to the server for storage. This completes the initialization of the account key pair. Then, the server can respond to the new terminal with a unique account public key identification code ID based on the account public key of the account key pair.
[1-2]如圖3所示,「帳號金鑰對之更新」之流程可包括下列步驟S31至步驟S38。 [1-2] As shown in Figure 3, the process of "updating the account key pair" may include the following steps S31 to step S38.
步驟S31:新終端透過非經由伺服器之方式從舊終端取得目前之帳號私鑰。例如,非經由伺服器之方式可包括:由舊終端之螢幕以16進位(HEX)、文字(如數字/字元/特殊符號)或快速響應碼(QR code)等方式顯示目前之帳號私鑰,再由新終端透過此16進位(HEX)、文字或快速響應碼(QR code)等方式從舊終端之螢幕上取得目前之帳號私鑰。 Step S31: The new terminal obtains the current account private key from the old terminal through a method other than the server. For example, non-server methods may include: displaying the current account private key on the screen of the old terminal in hexadecimal (HEX), text (such as numbers/characters/special symbols) or quick response code (QR code), etc. , and then the new terminal obtains the current account private key from the screen of the old terminal through this hexadecimal (HEX), text or quick response code (QR code).
步驟S32:新終端產生第一更新參數。例如,此第一更新參數可為一數字(如正整數)。 Step S32: The new terminal generates the first update parameter. For example, the first update parameter may be a number (such as a positive integer).
步驟S33:新終端使用目前之帳號私鑰與第一更新參數以產生一具有第一新帳號公鑰與第一新帳號私鑰之第一新帳號金鑰對。 Step S33: The new terminal uses the current account private key and the first update parameter to generate a first new account key pair having a first new account public key and a first new account private key.
步驟S34:新終端透過橢圓曲線密碼學(ECC)之方式產生一公私鑰對。此公私鑰對可稱為第一臨時金鑰對,且第一臨時金鑰對可具有第一臨時公鑰與第一臨時私鑰。 Step S34: The new terminal generates a public-private key pair through elliptic curve cryptography (ECC). This public-private key pair may be called a first temporary key pair, and the first temporary key pair may have a first temporary public key and a first temporary private key.
步驟S35:新終端依序使用多個(所有)舊終端之終端公鑰與第一臨時金鑰對之第一臨時私鑰以加密第一更新參數。 Step S35: The new terminal sequentially uses the terminal public keys of multiple (all) old terminals and the first temporary private key of the first temporary key pair to encrypt the first update parameter.
步驟S36:新終端將第一新帳號公鑰、第一臨時公鑰與已加密之第一更新參數上傳至伺服器。 Step S36: The new terminal uploads the first new account public key, the first temporary public key and the encrypted first update parameter to the server.
步驟S37:伺服器將已加密之第一更新參數同步至多個(所有)舊終端。 Step S37: The server synchronizes the encrypted first update parameters to multiple (all) old terminals.
步驟S38:多個(所有)舊終端更新自己之帳號金鑰對。 Step S38: Multiple (all) old terminals update their account key pairs.
[2]移除終端:如圖4所示,「移除終端」之流程可包括下列步驟S41至步驟S48。亦即,當使用者透過操作終端移除另一終端時,需更新帳號金鑰對,再將此帳號金鑰對之更新資訊同步至其餘終端。 [2] Removing the terminal: As shown in Figure 4, the process of "removing the terminal" may include the following steps S41 to step S48. That is, when the user removes another terminal by operating the terminal, the account key pair needs to be updated, and then the update information of the account key pair is synchronized to other terminals.
步驟S41:操作終端產生第二更新參數。例如,此第二更新參數可為一數字(如正整數)。 Step S41: The operation terminal generates the second update parameter. For example, the second update parameter may be a number (such as a positive integer).
步驟S42:操作終端使用目前之帳號私鑰與第二更新參數以產生一具有第二新帳號公鑰與第二新帳號私鑰之第二新帳號金鑰對。 Step S42: The operating terminal uses the current account private key and the second update parameter to generate a second new account key pair having a second new account public key and a second new account private key.
步驟S43:操作終端透過橢圓曲線密碼學(ECC)之方式產生一公私鑰對。此公私鑰對可稱為第二臨時金鑰對,且第二臨時金鑰對可具有第二臨時公鑰與第二臨時私鑰。 Step S43: The operating terminal generates a public-private key pair through elliptic curve cryptography (ECC). This public-private key pair may be called a second temporary key pair, and the second temporary key pair may have a second temporary public key and a second temporary private key.
步驟S44:操作終端依序使用欲移除之終端以外之其餘終端之終端公鑰與第二臨時私鑰以加密第二更新參數。 Step S44: The operating terminal sequentially uses the terminal public key and the second temporary private key of the terminals other than the terminal to be removed to encrypt the second update parameter.
步驟S45:操作終端將第二新帳號公鑰、第二臨時公鑰、已加密之第二更新參數與欲移除之終端之終端識別碼ID上傳至伺服器。 Step S45: The operating terminal uploads the second new account public key, the second temporary public key, the encrypted second update parameter and the terminal identification code ID of the terminal to be removed to the server.
步驟S46:伺服器將欲移除之終端失效並通知欲移除之終端。 Step S46: The server invalidates the terminal to be removed and notifies the terminal to be removed.
步驟S47:伺服器將已加密之第二更新參數同步至欲移除之終端以外之其餘終端。 Step S47: The server synchronizes the encrypted second update parameter to other terminals except the terminal to be removed.
步驟S48:欲移除之終端以外之其餘終端更新自己之帳號金鑰對。 Step S48: Terminals other than the terminal to be removed update their own account key pairs.
[3]收發訊息:如圖5所示,「收發訊息」之流程可包括下列步驟S51至步驟S59。亦即,發訊終端對聊天室內之帳號分別發送訊息密文(加 密訊息),發訊終端與收訊終端透過共同之棘輪金鑰與共同之衍生方法產生出對應之訊息金鑰以進行訊息之加密或解密。 [3] Sending and receiving messages: As shown in Figure 5, the process of "sending and receiving messages" may include the following steps S51 to step S59. That is, the sending terminal sends message ciphertext (added Encrypted message), the sending terminal and the receiving terminal generate corresponding message keys through a common ratchet key and a common derivation method to encrypt or decrypt the message.
步驟S51:發訊終端選擇一聊天室內尚未產生訊息密文(加密訊息)之帳號作為收訊帳號。 Step S51: The sending terminal selects an account in the chat room that has not yet generated message ciphertext (encrypted message) as the receiving account.
步驟S52:若發訊終端尚未對收訊帳號產生棘輪金鑰,則發訊終端對收訊帳號產生一具有第三臨時公鑰與第三臨時私鑰之第三臨時金鑰對,再由發訊終端將收訊帳號之帳號公鑰與發訊終端之第三臨時金鑰對之第三臨時私鑰進行運算以產生對收訊帳號之棘輪金鑰(如第N代棘輪金鑰)。N代表正整數,例如N=1,2,3…。 Step S52: If the sending terminal has not generated a ratchet key for the receiving account, the sending terminal generates a third temporary key pair with a third temporary public key and a third temporary private key for the receiving account, and then the sending terminal generates a third temporary key pair for the receiving account. The messaging terminal operates the account public key of the receiving account and the third temporary private key of the sending terminal's third temporary key pair to generate a ratchet key (such as the Nth generation ratchet key) for the receiving account. N represents a positive integer, such as N=1,2,3….
步驟S53:發訊終端使用對收訊帳號之棘輪金鑰衍生出訊息金鑰(如第N代訊息金鑰),並更新棘輪金鑰(如第N代棘輪金鑰)至下一代棘輪金鑰(如第N+1代棘輪金鑰)。 Step S53: The sending terminal uses the ratchet key of the receiving account to derive the message key (such as the Nth generation message key), and updates the ratchet key (such as the Nth generation ratchet key) to the next generation ratchet key. (Such as the N+1 generation ratchet key).
步驟S54:發訊終端使用對收訊帳號之棘輪金鑰所衍生出之訊息金鑰將訊息進行加密以產生訊息密文(加密訊息)。 Step S54: The sending terminal encrypts the message using the message key derived from the ratchet key of the receiving account to generate message ciphertext (encrypted message).
步驟S55:發訊終端檢查是否已對聊天室內之多個/所有帳號產生訊息密文(加密訊息)?若是(已對聊天室內之多個/所有帳號產生訊息密文),則繼續往下執行步驟S56;反之,若否(未對聊天室內之多個/所有帳號產生訊息密文),則返回上述步驟S51。 Step S55: Does the sending terminal check whether the message ciphertext (encrypted message) has been generated for multiple/all accounts in the chat room? If yes (message ciphertext has been generated for multiple/all accounts in the chat room), then continue to step S56; otherwise, if not (message ciphertext has not been generated for multiple/all accounts in the chat room), then return to the above. Step S51.
步驟S56:發訊終端將所有訊息密文(加密訊息)與金鑰資訊上傳至伺服器。例如,金鑰資訊可包括使用之棘輪金鑰之代數(如第N代)與衍生棘輪金鑰時之帳號公鑰識別碼ID,若棘輪金鑰為第一代棘輪金鑰,則金鑰資訊需再包括(附加)第三臨時公鑰。 Step S56: The sending terminal uploads all message ciphertext (encrypted message) and key information to the server. For example, the key information may include the generation number of the ratchet key used (such as the Nth generation) and the account public key identification code ID when the ratchet key was derived. If the ratchet key is the first-generation ratchet key, then the key information A third temporary public key needs to be included (appended).
步驟S57:伺服器檢查收訊帳號之帳號公鑰之有效性。若此帳號公鑰為無效,則伺服器回覆最新的帳號公鑰予發訊終端,以使發訊終端重新產生棘輪金鑰,並丟棄此訊息密文(加密訊息);反之,若此帳號公鑰為有效,則繼續往下執行步驟S58。 Step S57: The server checks the validity of the account public key of the receiving account. If the account public key is invalid, the server replies with the latest account public key to the sending terminal, so that the sending terminal regenerates the ratchet key and discards the message ciphertext (encrypted message); otherwise, if the account is public If the key is valid, continue to step S58.
步驟S58:伺服器將訊息密文(加密訊息)與金鑰資訊發送至收訊帳號下之多個(所有)收訊終端。 Step S58: The server sends the message ciphertext (encrypted message) and key information to multiple (all) receiving terminals under the receiving account.
步驟S59:各個收訊終端收到訊息(訊息密文)時,若各個收訊終端檢查出此訊息不具有對發訊終端之棘輪金鑰,則各個收訊終端將第三臨時公鑰與收訊帳號之帳號私鑰進行運算以產生棘輪金鑰(如第一代或第N代棘輪金鑰)。然後,各個收訊終端使用伺服器所發送之金鑰資訊以產生對應棘輪金鑰之代數之訊息金鑰(如第一代或第N代訊息金鑰),再由各個收訊終端使用對應棘輪金鑰之代數之訊息金鑰進行解密此訊息。 Step S59: When each receiving terminal receives the message (message ciphertext), if each receiving terminal checks that the message does not have a ratchet key for the sending terminal, each receiving terminal will combine the third temporary public key with the receiving terminal. The account private key of the message account is calculated to generate a ratchet key (such as the first generation or Nth generation ratchet key). Then, each receiving terminal uses the key information sent by the server to generate a message key corresponding to the algebra of the ratchet key (such as the first generation or Nth generation message key), and then each receiving terminal uses the corresponding ratchet key. The message key is the algebra of the key used to decrypt the message.
圖6為本發明之多終端之端對端加密通訊方法中,有關金鑰衍生方法之示意圖。如圖所示,發訊終端可將收訊帳號之帳號公鑰與第三臨時私鑰進行運算以產生棘輪金鑰(如第一代棘輪金鑰),而收訊終端則將第三臨時公鑰與收訊帳號之帳號私鑰進行運算以產生棘輪金鑰(如第一代棘輪金鑰)。 FIG. 6 is a schematic diagram of the key derivation method in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in the figure, the sending terminal can calculate the account public key of the receiving account and the third temporary private key to generate a ratchet key (such as the first-generation ratchet key), and the receiving terminal will use the third temporary public key. The key is calculated with the account private key of the receiving account to generate a ratchet key (such as the first generation ratchet key).
此外,發訊終端可使用金鑰雜湊訊息認證碼(keyed-hash message authentication code;HMAC)配合第一常數將棘輪金鑰衍生為訊息金鑰(如第一代訊息金鑰),以由發訊終端使用訊息金鑰(如第一代訊息金鑰)進行訊息之對稱式加密以產生訊息密文(加密訊息)。類似地,收訊終端亦可使用金鑰雜湊訊息認證碼(HMAC)配合第一常數將棘輪金鑰衍生為訊息金鑰(如第一代訊息金鑰),再由收訊終端使用訊息金鑰(如第一代訊息金鑰)將訊息密文(加 密訊息)進行解密出訊息。 In addition, the sending terminal can use the keyed-hash message authentication code (HMAC) and the first constant to derive the ratchet key into a message key (such as the first-generation message key) to send the message. The terminal uses a message key (such as a first-generation message key) to perform symmetric encryption of the message to generate message ciphertext (encrypted message). Similarly, the receiving terminal can also use the key hash message authentication code (HMAC) and the first constant to derive the ratchet key into a message key (such as the first-generation message key), and then the receiving terminal uses the message key (such as the first generation message key) convert the message ciphertext (plus encrypted message) to decrypt the message.
為確保金鑰安全,每次生成完訊息金鑰後,會將棘輪金鑰更新為下一代棘輪金鑰,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第二常數將第N代棘輪金鑰衍生至第N+1代棘輪金鑰(即下一代棘輪金鑰)。前述N代表正整數(如N=1,2,3…),第一常數與第二常數皆可為任意值,且第一常數不同於第二常數。 In order to ensure the security of the key, each time the message key is generated, the ratchet key will be updated to the next generation ratchet key, that is, the key hash message authentication code (HMAC) is used with the second constant to update the Nth generation ratchet key. The key is derived to the N+1 generation ratchet key (i.e., the next generation ratchet key). The aforementioned N represents a positive integer (such as N=1, 2, 3...), the first constant and the second constant can both be arbitrary values, and the first constant is different from the second constant.
舉一實施例來說,本發明採用橢圓曲線迪菲-赫爾曼金鑰交換(Elliptic Curve Diffie-Hellman key exchange;ECDH)協定,為使說明更易於理解,假設一聊天室內有第一帳號a與第二帳號b,第一帳號a擁有有效之終端a1與終端a2,而第二帳號b尚未擁有有效之終端。 As an example, the present invention uses the Elliptic Curve Diffie-Hellman key exchange (ECDH) protocol. To make the explanation easier to understand, assume that there is a first account a in a chat room. With the second account b, the first account a has valid terminal a1 and terminal a2, while the second account b does not have a valid terminal yet.
關於本實施例之符號之意義,茲舉例說明如下。Message:代表訊息(如即時通訊訊息),且訊息包括但不限於文字、圖片、音訊、影片或檔案格式等。CT_Messagea1_b:代表終端a1所產生之訊息密文,且僅第二帳號b之終端可以解密。(,)代表終端a1之終端公鑰、終端私鑰。(,):代表第一帳號a之帳號公鑰、帳號私鑰。(,):代表終端a1所產生之臨時公鑰、臨時私鑰。 The meanings of the symbols in this embodiment are explained below with examples. Message: represents a message (such as an instant messaging message), and the message includes but is not limited to text, pictures, audio, video or file formats, etc. CT_Message a1_b : represents the ciphertext of the message generated by terminal a1, and only the terminal with second account b can decrypt it. ( , ) represents the terminal public key and terminal private key of terminal a1. ( , ): represents the account public key and account private key of the first account a. ( , ): represents the temporary public key and temporary private key generated by terminal a1.
此外,ECDH(P,R):代表透過橢圓曲線密碼學(ECC)之公鑰P與私鑰R進行橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定之運算結果。G:代表橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定所使用之橢圓曲線之基點。AESencrypt(Key,Plaintext):代表透過進階加密標準(Advanced Encryption Standard;AES)演算法(如AES256演算法),將明文Plaintext(即未加密之訊息)使用金鑰Key進行加密以產生訊息密文Ciphertext。AESdecrypt(Key, Ciphertext):代表透過進階加密標準(AES)演算法(如AES256演算法),將訊息密文Ciphertext使用金鑰Key進行解密以產生明文Plaintext(即已解密之訊息)。HMAC(Key,Message):代表使用金鑰Key將訊息Message進行金鑰雜湊訊息認證碼(HMAC)與安全雜湊演算法(Secure Hash Algorithm;SHA)之函數運算,且安全雜湊演算法可為安全雜湊演算法256位元(Secure Hash Algorithm 256-bit;SHA256)等。 also, ECDH(P,R): represents the calculation result of the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol through the public key P and private key R of Elliptic Curve Cryptography (ECC). G: represents the base point of the elliptic curve used by the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol. AES encrypt (Key, Plaintext): represents the use of the Advanced Encryption Standard (AES) algorithm (such as the AES256 algorithm) to encrypt the plaintext (ie, unencrypted message) using the golden key to generate a message encryption key. Ciphertext. AES decrypt (Key, Ciphertext): represents the use of the Advanced Encryption Standard (AES) algorithm (such as the AES256 algorithm) to decrypt the message Ciphertext using the key to generate the plaintext (i.e. the decrypted message). HMAC (Key, Message): Represents the use of the key Key to perform function operations on the message Message between the key hash message authentication code (HMAC) and the secure hash algorithm (Secure Hash Algorithm; SHA), and the secure hash algorithm can be secure hash. Algorithm 256-bit (Secure Hash Algorithm 256-bit; SHA256), etc.
圖7為本發明之多終端之端對端加密通訊方法中,有關圖1所示「新增終端」之實施例示意圖。如圖7所示,新增終端之情境實施時,假設第一帳號a新增一新終端a3,且第二帳號b新增一新終端b1,則本實施例可包括下列程序P11至程序P14之內容。 Figure 7 is a schematic diagram of an embodiment of the "new terminal" shown in Figure 1 in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in Figure 7, when the scenario of adding a terminal is implemented, assuming that the first account a adds a new terminal a3, and the second account b adds a new terminal b1, then this embodiment may include the following procedures P11 to P14 the content.
程序P11(見圖1之步驟S11):第一帳號a之新終端a3與第二帳號b之新終端b1透過橢圓曲線密碼學(ECC)之方式各自產生一具有終端公鑰與終端私鑰之終端金鑰對。例如,第一帳號a之新終端a3透過橢圓曲線密碼學(ECC)之方式產生一具有終端公鑰與終端私鑰之終端金鑰對,第二帳號b之新終端b1透過橢圓曲線密碼學(ECC)之方式產生一具有終端公鑰與終端私鑰之終端金鑰對,新終端a3保存自己之終端金鑰對之終端私鑰,且新終端b1保存自己之終端金鑰對之終端私鑰。 Procedure P11 (see step S11 in Figure 1): The new terminal a3 of the first account a and the new terminal b1 of the second account b each generate a terminal public key and a terminal private key through elliptic curve cryptography (ECC). Terminal key pair. For example, the new terminal a3 of the first account a generates a terminal public key through elliptic curve cryptography (ECC). with terminal private key For the terminal key pair, the new terminal b1 of the second account b generates a terminal public key through elliptic curve cryptography (ECC). with terminal private key The terminal key pair, the new terminal a3 saves the terminal private key of its own terminal key pair , and the new terminal b1 saves the terminal private key of its own terminal key pair .
程序P12(見圖1之步驟S12):新終端a3與新終端b1上傳自己之終端金鑰對之終端公鑰至伺服器c。例如,新終端a3上傳自己之終端金鑰對之終端公鑰至伺服器c,且新終端b1上傳自己之終端金鑰對之終端公鑰至伺服器c。 Procedure P12 (see step S12 in Figure 1): The new terminal a3 and the new terminal b1 upload the terminal public keys of their own terminal key pairs to the server c. For example, the new terminal a3 uploads the terminal public key of its own terminal key pair to server c, and the new terminal b1 uploads the terminal public key of its own terminal key pair to server c.
程序P13(見圖1之步驟S13):伺服器c將有效終端資訊列表回 傳給新終端a3與新終端b1。例如,伺服器c將第一帳號a之有效終端資訊列表[a1,a2,a3]回傳給新終端a3,並將第二帳號b之有效終端資訊列表[b1]回傳給新終端b1。 Program P13 (see step S13 in Figure 1): Server c returns the valid terminal information list Passed to new terminal a3 and new terminal b1. For example, server c returns the valid terminal information list [a1, a2, a3] of the first account a to the new terminal a3, and returns the valid terminal information list [b1] of the second account b to the new terminal b1.
程序P14(見圖1之步驟S14):新終端a3與新終端b1分別依據第一帳號a之有效終端資訊列表[a1,a2,a3]與第二帳號b之有效終端資訊列表[b1]判斷應進行帳號金鑰對之初始化或更新。例如,因第一帳號a已擁有有效之終端a1與終端a2,故新終端a3需進行帳號金鑰對之更新。而第二帳號b尚未擁有有效之終端,新終端b1為第二帳號b之唯一有效終端,故新終端b1需進行帳號金鑰對之初始化。 Program P14 (see step S14 in Figure 1): The new terminal a3 and the new terminal b1 are respectively judged based on the valid terminal information list [a1, a2, a3] of the first account a and the valid terminal information list [b1] of the second account b. The account key pair should be initialized or updated. For example, since the first account a already has valid terminal a1 and terminal a2, the new terminal a3 needs to update the account key pair. The second account b does not yet have a valid terminal, and the new terminal b1 is the only valid terminal of the second account b, so the new terminal b1 needs to initialize the account key pair.
圖8為本發明之多終端之端對端加密通訊方法中,有關圖2所示「帳號金鑰對之初始化」之實施例示意圖。如圖8所示,帳號金鑰對之初始化之情境實施時,假設新終端b1產生帳號金鑰對,則本實施例可包括下列程序P21至程序P23之內容。 Figure 8 is a schematic diagram of an embodiment of the "initialization of the account key pair" shown in Figure 2 in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in FIG. 8 , when the scenario of initializing the account key pair is implemented, assuming that the new terminal b1 generates an account key pair, this embodiment may include the following contents from procedures P21 to P23.
程序P21(見圖2之步驟S21):新終端b1透過橢圓曲線密碼學(ECC)之方式產生一具有帳號公鑰與帳號私鑰之帳號金鑰對。 Procedure P21 (see step S21 in Figure 2): The new terminal b1 generates an account public key through elliptic curve cryptography (ECC). with account private key The account key pair.
程序P22(見圖2之步驟S22):新終端b1上傳第二帳號b(見圖7)之帳號金鑰對之帳號公鑰至伺服器c中儲存,即完成帳號金鑰對之初始化。 Procedure P22 (see step S22 in Figure 2): The new terminal b1 uploads the account public key of the account key pair of the second account b (see Figure 7) Store it in server c, which completes the initialization of the account key pair.
程序P23:伺服器c可依據第二帳號b之帳號金鑰對之帳號公鑰回應具有唯一值之帳號公鑰識別碼ID予新終端b1。 Procedure P23: Server c can use the account public key of the account key pair of the second account b Respond to the new terminal b1 with the account public key identification code ID having a unique value.
圖9為本發明之多終端之端對端加密通訊方法中,有關圖3所示「帳號金鑰對之更新」之實施例示意圖。如圖9所示,帳號金鑰對之更新 之情境實施時,假設新終端a3更新帳號金鑰對,則本實施例可包括下列程序P31至程序P39之內容。 Figure 9 is a schematic diagram of an embodiment of the "update of account key pair" shown in Figure 3 in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in Figure 9, the account key pair is updated. When implementing this scenario, assuming that the new terminal a3 updates the account key pair, this embodiment may include the following contents from procedures P31 to P39.
程序P31(見圖3之步驟S31):新終端a3以非經由伺服器c之方式從終端a1(如舊終端)取得第一帳號a(見圖7)目前之帳號私鑰。例如,由終端a1(如舊終端)之螢幕以16進位(HEX)等方式顯示第一帳號a目前之帳號私鑰,再由使用者於新終端a3輸入第一帳號a目前之帳號私鑰。 Procedure P31 (see step S31 in Figure 3): The new terminal a3 obtains the current account private key of the first account a (see Figure 7) from the terminal a1 (such as the old terminal) without going through the server c. . For example, the current account private key of the first account a is displayed on the screen of terminal a1 (such as the old terminal) in a hexadecimal (HEX) format. , and then the user enters the current account private key of the first account a in the new terminal a3 .
程序P32(見圖3之步驟S32至步驟S33):新終端a3產生第一更新參數Parm(如數字或正整數)。然後,新終端a3可使用第一帳號a目前之帳號私鑰與第一更新參數Parm以產生一具有第一新帳號公鑰與第一新帳號私鑰之第一新帳號金鑰對。 Program P32 (see steps S32 to S33 in Figure 3): the new terminal a3 generates the first update parameter Parm (such as a number or a positive integer). Then, the new terminal a3 can use the current account private key of the first account a and the first update parameter Parm to generate a first new account key pair having a first new account public key and a first new account private key.
例如,由新終端a3運算下列二個公式:XOR Parm,亦即將第一帳號a之帳號私鑰與第一更新參數Parm兩者進行互斥或(XOR)運算以產生第一新帳號金鑰對之第一新帳號私鑰。,亦即依據第一新帳號私鑰與橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定所使用之橢圓曲線之基點G以產生或推論出第一新帳號金鑰對之第一新帳號公鑰。 For example, the new terminal a3 calculates the following two formulas: XOR Parm, which is the account private key of the first account a Perform a mutually exclusive OR (XOR) operation with the first update parameter Parm to generate the first new account private key of the first new account key pair. . , that is, based on the first account private key The base point G of the elliptic curve used in the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol is used to generate or deduce the first new account public key of the first new account key pair. .
程序P33(見圖3之步驟S34至步驟S35):新終端a3透過橢圓曲線密碼學(ECC)之方式產生一具有第一臨時公鑰與第一臨時私鑰之第一臨時金鑰對,再由新終端a3依序使用多個/所有舊終端(如終端a1與終端a2)之終端公鑰與第一臨時私鑰以加密第一更新參數Parm。 Procedure P33 (see steps S34 to S35 in Figure 3): The new terminal a3 generates a first temporary public key through elliptic curve cryptography (ECC). with the first temporary private key The first temporary key pair, and then the new terminal a3 sequentially uses the terminal public keys and the first temporary private keys of multiple/all old terminals (such as terminal a1 and terminal a2) To encrypt the first update parameter Parm.
例如,由新終端a3運算下列四個公式: ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將終端a1(如舊終端)之終端公鑰與新終端a3之第一臨時私鑰進行運算以產生終端a1(如舊終端)與新終端a3兩者之共享臨時金鑰。 ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將終端a2(如舊終端)之終端公鑰與新終端a3之第一臨時私鑰進行運算以產生終端a2(如舊終端)與新終端a3兩者之共享臨時金鑰。,亦即透過進階加密標準(AES)演算法將終端a1(如舊終端)與新終端a3兩者之共享臨時金鑰配合第一更新參數Parm進行運算以產生終端a1(如舊終端)之更新參數密文CT_Parma1。,亦即透過進階加密標準(AES)演算法將終端a2(如舊終端)與新終端a3兩者之共享臨時金鑰配合第一更新參數Parm進行運算以產生終端a2(如舊終端)之更新參數密文CT_Parma2。 For example, the following four formulas are calculated by the new terminal a3: , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the terminal public key of terminal a1 (such as the old terminal) With the first temporary private key of the new terminal a3 Perform operations to generate the shared temporary key between terminal a1 (such as the old terminal) and the new terminal a3 . , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the terminal public key of terminal a2 (such as the old terminal) With the first temporary private key of the new terminal a3 Perform operations to generate the shared temporary key between terminal a2 (such as the old terminal) and the new terminal a3 . , that is, using the Advanced Encryption Standard (AES) algorithm to share the temporary key between terminal a1 (such as the old terminal) and the new terminal a3. The calculation is performed in conjunction with the first update parameter Parm to generate the update parameter ciphertext CT_Parm a1 of the terminal a1 (such as the old terminal). , that is, using the Advanced Encryption Standard (AES) algorithm to share the temporary key between terminal a2 (such as the old terminal) and the new terminal a3. The calculation is performed in conjunction with the first update parameter Parm to generate the update parameter ciphertext CT_Parm a2 of the terminal a2 (such as the old terminal).
程序P34:新終端a3將更新資訊上傳至伺服器c。例如,此更新資訊可包括下列資訊:(1)終端a1之更新參數密文CT_Parma1與終端a2之更新參數密文CT_Parma2,(2)新終端a3之第一臨時公鑰。 Procedure P34: New terminal a3 uploads update information to server c. For example, this update information may include the following information: (1) the update parameter ciphertext CT_Parm a1 of terminal a1 and the update parameter ciphertext CT_Parm a2 of terminal a2, (2) the first temporary public key of the new terminal a3 .
程序P35:伺服器c收到來自新終端a3之更新資訊後,由伺服器c執行合法性檢查。例如,伺服器c之合法性檢查可包括:(1)確認無相同終端集合之有效帳號公鑰,(2)確認更新參數密文之對象與帳號之有效終端相同。 Procedure P35: After server c receives the update information from new terminal a3, server c performs a legality check. For example, the validity check of server c may include: (1) confirming that there is no valid account public key for the same terminal set, (2) confirming that the object of the update parameter ciphertext is the same as the valid terminal of the account.
程序P36:伺服器c回應相關資訊予新終端a3。例如,若伺服器c所執行之合法性檢查之結果為合法,則伺服器c回應具有唯一值之帳號公鑰識別碼ID予新終端a3;反之,若伺服器c所執行之合法性檢查之結果為 不合法,則伺服器c回應目前帳號(如第一帳號a)之有效終端資訊列表予新終端a3。 Procedure P36: Server c responds with relevant information to new terminal a3. For example, if the result of the legality check performed by server c is legal, server c responds with a unique account public key identification code ID to the new terminal a3; conversely, if the legality check performed by server c is The result is Illegal, server c responds to the new terminal a3 with a valid terminal information list of the current account (such as the first account a).
程序P37:當終端a1或終端a2(如舊終端)上線時,由伺服器c將更新資訊同步至終端a1或終端a2(如舊終端)。 Procedure P37: When terminal a1 or terminal a2 (such as the old terminal) comes online, server c will synchronize the update information to terminal a1 or terminal a2 (such as the old terminal).
程序P38:終端a1或終端a2(如舊終端)使用自己之終端金鑰對之終端私鑰解密出第一更新參數Parm。例如,由終端a1(如舊終端)運算下列二個公式:,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將新終端a3之第一臨時公鑰與終端a1(如舊終端)自己之終端金鑰對之終端私鑰進行運算以產生終端a1(如舊終端)與新終端a3兩者之共享臨時金鑰。,亦即透過進階加密標準(AES)演算法以使用終端a1(如舊終端)與新終端a3兩者之共享臨時金鑰配合終端a1之更新參數密文CT_Parma1來解密出第一更新參數Parm。 Procedure P38: Terminal a1 or terminal a2 (such as the old terminal) uses the terminal private key of its own terminal key pair to decrypt the first update parameter Parm. For example, the following two formulas are calculated by terminal a1 (such as the old terminal): , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the first temporary public key of the new terminal a3 The terminal private key paired with terminal a1 (such as the old terminal)'s own terminal key Perform operations to generate the shared temporary key between terminal a1 (such as the old terminal) and the new terminal a3 . , that is, using the Advanced Encryption Standard (AES) algorithm to use the shared temporary key between terminal a1 (such as the old terminal) and the new terminal a3 Cooperate with the update parameter ciphertext CT_Parm a1 of the terminal a1 to decrypt the first update parameter Parm.
此外,由終端a2(如舊終端)運算下列二個公式: ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將新終端a3之第一臨時公鑰與終端a2(如舊終端)自己之終端金鑰對之終端私鑰進行運算以產生終端a2(如舊終端)與新終端a3兩者之共享臨時金鑰。,亦即透過進階加密標準(AES)演算法以使用終端a2(如舊終端)與新終端a3兩者之共享臨時金鑰配合終端a2之更新參數密文CT_Parma2來解密出第一更新參數Parm。 In addition, the following two formulas are calculated by terminal a2 (like the old terminal): , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the first temporary public key of the new terminal a3 Terminal private key paired with terminal a2 (like the old terminal)'s own terminal key Perform operations to generate the shared temporary key between terminal a2 (such as the old terminal) and the new terminal a3 . , that is, using the Advanced Encryption Standard (AES) algorithm to use the shared temporary key between terminal a2 (such as the old terminal) and the new terminal a3 Cooperate with the update parameter ciphertext CT_Parm a2 of terminal a2 to decrypt the first update parameter Parm.
程序P39(見圖3之步驟S38):終端a1或終端a2(如舊終端)更新自己之帳號金鑰對。例如,由終端a1或終端a2(如舊終端)運算下列二個公 式:,亦即將第一帳號a之帳號私鑰與第一更新參數Parm兩者進行互斥或(XOR)運算以產生第一新帳號金鑰對之第一新帳號私鑰。,亦即依據第一新帳號私鑰與橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定所使用之橢圓曲線之基點G以產生或推論出第一新帳號金鑰對之第一新帳號公鑰。 Procedure P39 (see step S38 in Figure 3): Terminal a1 or terminal a2 (such as the old terminal) updates its account key pair. For example, the following two formulas are calculated by terminal a1 or terminal a2 (such as the old terminal): , that is, the account private key of the first account a Perform a mutually exclusive OR (XOR) operation with the first update parameter Parm to generate the first new account private key of the first new account key pair. . , that is, based on the first account private key The base point G of the elliptic curve used in the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol is used to generate or deduce the first new account public key of the first new account key pair. .
圖10為本發明之多終端之端對端加密通訊方法中,有關圖4所示「移除終端」之實施例示意圖。如圖10所示,移除終端之情境實施時,假設使用者欲透過第一帳號a(見圖7)之終端a1(如操作終端)移除新終端a3,則本實施例可包括下列程序P41至程序P49之內容。 Figure 10 is a schematic diagram of an embodiment of "removing the terminal" shown in Figure 4 in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in Figure 10, when the scenario of removing the terminal is implemented, assuming that the user wants to remove the new terminal a3 through the terminal a1 (such as the operating terminal) of the first account a (see Figure 7), then this embodiment may include the following procedures Contents from P41 to Program P49.
程序P41(見圖4之步驟S41至步驟S42):終端a1(如操作終端)產生第二更新參數Parm,且終端a1(如操作終端)可產生一具有第二新帳號公鑰與第二新帳號私鑰之第二新帳號金鑰對。 Program P41 (see steps S41 to S42 in Figure 4): Terminal a1 (such as an operation terminal) generates the second update parameter Parm, and the terminal a1 (such as an operation terminal) can generate a public key with a second new account with the second new account private key The second new account key pair.
例如,由終端a1(如操作終端)運算下列二個公式: ,亦即將第一帳號a之帳號私鑰與第二更新參數Parm兩者進行互斥或(XOR)運算以產生第二新帳號金鑰對之第二新帳號私鑰。,亦即依據第二新帳號私鑰與橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定所使用之橢圓曲線之基點G以產生或推論出第二新帳號金鑰對之第二新帳號公鑰。 For example, the following two formulas are calculated by terminal a1 (such as an operation terminal): , that is, the account private key of the first account a Perform a mutually exclusive OR (XOR) operation with the second update parameter Parm to generate the second new account private key of the second new account key pair. . , that is, based on the second account private key Use the base point G of the elliptic curve used in the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol to generate or deduce the second account public key of the second account key pair. .
程序P42(見圖4之步驟S43):終端a1(如操作終端)透過橢圓曲線密碼學(ECC)之方式產生一具有第二臨時公鑰與第二臨時私鑰之第二臨時金鑰對。然後,終端a1(如操作終端)可將第二更新參數Parm加密成終端a2之更新參數密文CT_Parma2。 Procedure P42 (see step S43 in Figure 4): Terminal a1 (such as an operating terminal) generates a second temporary public key through elliptic curve cryptography (ECC). with the second temporary private key The second temporary key pair. Then, the terminal a1 (such as an operation terminal) can encrypt the second update parameter Parm into the update parameter ciphertext CT_Parm a2 of the terminal a2 .
例如,由終端a1(如操作終端)運算下列二個公式: ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將終端a2之終端公鑰與終端a1(如操作終端)之第二臨時私鑰進行運算以產生終端a1(如操作終端)與終端a2兩者之共享臨時金鑰。,亦即透過進階加密標準(AES)演算法使用終端a1(如操作終端)與終端a2兩者之共享臨時金鑰將第二更新參數Parm加密成終端a2之更新參數密文CT_Parma2。 For example, the following two formulas are calculated by terminal a1 (such as an operation terminal): , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the terminal public key of terminal a2 and the second temporary private key of terminal a1 (such as operating terminal) Perform operations to generate a shared temporary key between terminal a1 (such as an operating terminal) and terminal a2 . , that is, using the shared temporary key between terminal a1 (such as an operating terminal) and terminal a2 through the Advanced Encryption Standard (AES) algorithm. The second update parameter Parm is encrypted into the update parameter ciphertext CT_Parm a2 of terminal a2.
程序P43:終端a1(如操作終端)將更新資訊上傳至伺服器c。例如,此更新資訊可包括下列資訊:(1)終端a2之更新參數密文CT_Parma2,(2)終端a1(如操作終端)之第二臨時公鑰,(3)新終端a3(如欲移除之終端)之終端識別碼ID。 Procedure P43: Terminal a1 (such as an operation terminal) uploads update information to server c. For example, this update information may include the following information: (1) the update parameter ciphertext CT_Parm a2 of terminal a2, (2) the second temporary public key of terminal a1 (such as an operation terminal) , (3) The terminal identification code ID of the new terminal a3 (such as the terminal to be removed).
程序P44(見圖4之步驟S46):伺服器c收到來自終端a1(如操作終端)之更新資訊後,由伺服器c執行合法性檢查。例如,此合法性檢查可包括:(1)確認無相同終端集合之有效帳號公鑰,(2)確認更新參數密文之對象與帳號之有效終端(不包括欲移除之終端)相同。若伺服器c所執行之合法性檢查之結果為合法,則由伺服器c將新終端a3失效。 Program P44 (see step S46 in Figure 4): After server c receives the update information from terminal a1 (such as an operation terminal), server c performs a legality check. For example, this legality check may include: (1) confirming that there is no valid account public key for the same terminal set, (2) confirming that the object of the update parameter ciphertext is the same as the valid terminal of the account (excluding the terminal to be removed). If the result of the validity check performed by server c is legal, server c will invalidate the new terminal a3.
程序P45:伺服器c回應相關資訊予終端a1(如操作終端)。例如,若伺服器c所執行之合法性檢查之結果為合法,則伺服器c回應具有唯一值之帳號公鑰識別碼ID予終端a1(如操作終端);反之,若伺服器c所執行之合法性檢查之結果為不合法,則伺服器c回應目前帳號(如第一帳號a)之有效終端資訊列表予終端a1(如操作終端)。 Procedure P45: Server c responds with relevant information to terminal a1 (such as operating terminal). For example, if the result of the legality check performed by server c is legal, server c responds with a unique account public key identification code ID to terminal a1 (such as an operation terminal); otherwise, if the result of the legality check performed by server c is If the result of the legality check is illegal, the server c responds to the terminal a1 (such as the operating terminal) with a valid terminal information list of the current account (such as the first account a).
程序P46(見圖4之步驟S46):伺服器c通知新終端a3已移除 此新終端a3。 Procedure P46 (see step S46 in Figure 4): Server c notifies the new terminal a3 that it has been removed This new terminal a3.
程序P47:當終端a2上線時,由伺服器c將更新資訊同步至終端a2。 Procedure P47: When terminal a2 comes online, server c will synchronize the update information to terminal a2.
程序P48:終端a2使用自己之終端金鑰對之終端私鑰進行解密以得到第二更新參數Parm。例如,由終端a2運算下列二個公式:,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定將終端a1(如操作終端)之第二臨時公鑰與終端a2自己之終端金鑰對之終端私鑰進行運算以產生終端a1(如操作終端)與終端a2兩者之共享臨時金鑰。,亦即透過進階加密標準(AES)演算法以使用終端a1(如操作終端)與終端a2兩者之共享臨時金鑰配合終端a2之更新參數密文CT_Parma2來解密出第二更新參數Parm。 Procedure P48: Terminal a2 uses the terminal private key of its own terminal key pair Decrypt to obtain the second update parameter Parm. For example, the following two formulas are calculated by terminal a2: , that is, according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol, the second temporary public key of terminal a1 (such as an operating terminal) Terminal private key paired with terminal a2's own terminal key Perform operations to generate a shared temporary key between terminal a1 (such as an operating terminal) and terminal a2 . , that is, using the Advanced Encryption Standard (AES) algorithm to use the shared temporary key between terminal a1 (such as an operating terminal) and terminal a2 Cooperate with the update parameter ciphertext CT_Parm a2 of terminal a2 to decrypt the second update parameter Parm.
程序P49(見圖4之步驟S48):終端a2(如其餘終端)更新自己之帳號金鑰對。例如,由終端a2運算下列二個公式:Parm,亦即將第一帳號a之帳號私鑰與第二更新參數Parm兩者進行互斥或(XOR)運算以產生第二新帳號金鑰對之第二新帳號私鑰。,亦即依據第二新帳號私鑰與橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定所使用之橢圓曲線之基點G以產生或推論出第二新帳號金鑰對之第二新帳號公鑰。 Procedure P49 (see step S48 in FIG. 4 ): Terminal a2 (such as other terminals) updates its own account key pair. For example, terminal a2 calculates the following two formulas: Parm, that is, the private key of the first account a Perform an exclusive OR (XOR) operation with the second update parameter Parm to generate the second new account private key of the second new account key pair . , that is, based on the private key of the second new account The second new account public key of the second new account key pair is generated or inferred from the base point G of the elliptical curve used in the ECDH protocol .
圖11為本發明之多終端之端對端加密通訊方法中,有關圖5所示「收發訊息」之實施例示意圖。如圖11所示,收發訊息之情境實施時,假設第二帳號b(見圖7)已再成功新增一新終端b2,且由終端a1(如發訊終端)初 次發送訊息給第二帳號b,則本實施例可包括下列程序P51至程序P65之內容。 Figure 11 is a schematic diagram of an embodiment of "sending and receiving messages" shown in Figure 5 in the multi-terminal end-to-end encrypted communication method of the present invention. As shown in Figure 11, when the scenario of sending and receiving messages is implemented, it is assumed that the second account b (see Figure 7) has successfully added a new terminal b2, and the terminal a1 (such as the sending terminal) initially To send a message to the second account b once, this embodiment may include the following contents from program P51 to program P65.
程序P51(見圖5之步驟S51):終端a1(如發訊終端)選擇第二帳號b作為收訊帳號,並確認未對第二帳號b(如收訊帳號)產生棘輪金鑰(如第一代棘輪金鑰)。 Procedure P51 (see step S51 in Figure 5): Terminal a1 (such as the sending terminal) selects the second account b as the receiving account, and confirms that no ratchet key is generated for the second account b (such as the receiving account) (Such as the first generation ratchet key).
程序P52(見圖5之步驟S52):終端a1(如發訊終端)產生一具有第三臨時公鑰與第三臨時私鑰之第三臨時金鑰對。 Procedure P52 (see step S52 in Figure 5): Terminal a1 (such as the sending terminal) generates a third temporary public key with the third temporary private key The third temporary key pair.
程序P53(見圖5之步驟S52):終端a1(如發訊終端)計算棘輪金鑰(如第一代棘輪金鑰)。例如,由終端a1(如發訊終端)運算下列公式:,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定以使用第二帳號b(如收訊帳號)之帳號公鑰與終端a1(如發訊終端)之第三臨時私鑰計算出棘輪金鑰(如第一代棘輪金鑰)。 Program P53 (see step S52 in Figure 5): Terminal a1 (such as the sending terminal) calculates the ratchet key (Such as the first generation ratchet key). For example, terminal a1 (such as the sending terminal) calculates the following formula: , that is, based on the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol to use the account public key of the second account b (such as the receiving account) and the third temporary private key of terminal a1 (such as the sending terminal) Calculate the ratchet key (Such as the first generation ratchet key).
程序P54(見圖5之步驟S53):終端a1(如發訊終端)使用棘輪金鑰(如第一代棘輪金鑰)與第一常數衍生出訊息金鑰,並由終端a1(如發訊終端)使用第二常數將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰(如第二代棘輪金鑰)。 Program P54 (see step S53 in Figure 5): Terminal a1 (such as the sending terminal) uses the ratchet key (such as the first generation ratchet key) and the first constant to derive the message key , and the terminal a1 (such as the sending terminal) uses the second constant to change the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key).
例如,由終端a1(如發訊終端)運算下列二個公式:,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第一常數(如0x1)將棘輪金鑰(如第一代棘輪金鑰)衍生為訊息金鑰(如第一代訊息金鑰)。 ,亦即使用第二常數(如0x2)將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰(如第二代棘輪金鑰)。 For example, terminal a1 (such as the sending terminal) calculates the following two formulas: , that is, using the key hash message authentication code (HMAC) and the first constant (such as 0x1) to convert the ratchet key (such as the first generation ratchet key) is derived as a message key (Such as the first generation message key). , that is, using a second constant (such as 0x2) to change the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key).
程序P55(見圖5之步驟S54):終端a1(如發訊終端)使用訊息金鑰將訊息Message進行加密以產生訊息密文CT_Messagea1_b。例如,由終端a1(如發訊終端)運算下列公式:Message),亦即透過進階加密標準(AES)演算法以使用訊息金鑰(如第一代訊息金鑰)將訊息Message進行加密而產生訊息密文。 Procedure P55 (see step S54 in Figure 5): The terminal a1 (such as the sending terminal) uses the message key to encrypt the message Message to generate the message ciphertext CT_Message a1_b . For example, terminal a1 (such as the sending terminal) calculates the following formula: Message), that is, using the message key through the Advanced Encryption Standard (AES) algorithm (such as the first generation message key) encrypts the message to generate the message ciphertext .
程序P56:終端a1(如發訊終端)選擇第一帳號a作為收訊帳號,並確認未對第一帳號a產生棘輪金鑰(如第一代棘輪金鑰)。 Procedure P56: Terminal a1 (such as the sending terminal) selects the first account a as the receiving account and confirms that no ratchet key is generated for the first account a (Such as the first generation ratchet key).
程序P57:終端a1(如發訊終端)產生終端a1之第三臨時公鑰與第三臨時私鑰。 Procedure P57: Terminal a1 (such as the sending terminal) generates the third temporary public key of terminal a1 with the third temporary private key .
程序P58:終端a1(如發訊終端)計算棘輪金鑰(如第一代棘輪金鑰)。例如,由終端a1(如發訊終端)運算下列公式: ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定以使用第一帳號a之帳號公鑰與終端a1(如發訊終端)之第三臨時私鑰計算出棘輪金鑰(如第一代棘輪金鑰)。 Program P58: Terminal a1 (such as the sending terminal) calculates the ratchet key (Such as the first generation ratchet key). For example, terminal a1 (such as the sending terminal) calculates the following formula: , that is, using the account public key of the first account a according to the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol and the third temporary private key of terminal a1 (such as the sending terminal) Calculate the ratchet key (Such as the first generation ratchet key).
程序P59:終端a1(如發訊終端)使用棘輪金鑰(如第一代棘輪金鑰)衍生出訊息金鑰(如第一代訊息金鑰),並使用第二常數將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰(如第二代棘輪金鑰)。 Procedure P59: Terminal a1 (such as the sending terminal) uses the ratchet key (such as the first generation ratchet key) derived from the message key (such as the first generation message key), and use the second constant to convert the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key).
例如,由終端a1(如發訊終端)運算下列二個公式:,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第一常數(如0x1)將棘輪金鑰(如第一代棘輪金鑰)衍生為訊息金鑰(如第一代訊息金鑰)。 ,亦即使用第二常數(如0x2)將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰(如第二代棘輪金鑰)。 For example, terminal a1 (such as the sending terminal) calculates the following two formulas: , that is, using the key hash message authentication code (HMAC) and the first constant (such as 0x1) to convert the ratchet key (such as the first generation ratchet key) is derived as a message key (Such as the first generation message key). , that is, using a second constant (such as 0x2) to change the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key).
程序P60:終端a1(如發訊終端)將訊息Message進行加密以產生訊息密文CT_Messagea1_a。例如,由終端a1(如發訊終端)運算下列公式:,亦即透過進階加密標準(AES)演算法以使用訊息金鑰(如第一代訊息金鑰)將訊息Message進行加密而產生訊息密文CT_Messagea1_a。 Procedure P60: The terminal a1 (such as the sending terminal) encrypts the message Message to generate the message ciphertext CT_Message a1_a . For example, terminal a1 (such as the sending terminal) calculates the following formula: , that is, using the message key through the Advanced Encryption Standard (AES) algorithm (such as the first generation message key) encrypts the message Message to generate the message ciphertext CT_Message a1_a .
程序P61(見圖5之步驟S56):終端a1(如發訊終端)將訊息密文與金鑰資訊上傳至伺服器c。例如,有關第一帳號a之訊息密文與金鑰資訊可包括:(1)訊息密文CT_Messagea1_a,(2)金鑰資訊(使用之帳號公鑰識別碼ID、棘輪金鑰之代數),(3)如為棘輪金鑰為第一代棘輪金鑰,則需再包括(附加)第三臨時公鑰。此外,有關第二帳號b(如收訊帳號)之訊息密文與金鑰資訊可包括:(1)訊息密文CT_Messagea1_b,(2)金鑰資訊(使用之帳號公鑰識別碼ID、棘輪金鑰之代數),(3)如棘輪金鑰為第一代棘輪金鑰,則需再包括(附加)第三臨時公鑰。 Procedure P61 (see step S56 in Figure 5): Terminal a1 (such as the sending terminal) uploads the message ciphertext and key information to server c. For example, the message ciphertext and key information about the first account a may include: (1) message ciphertext CT_Message a1_a , (2) key information (the account public key identification code ID used, the algebra of the ratchet key), (3) If the ratchet key is a first-generation ratchet key, a third temporary public key needs to be included (additional). In addition, the message ciphertext and key information about the second account b (such as the receiving account) may include: (1) message ciphertext CT_Message a1_b , (2) key information (account public key identification code ID, ratchet The algebra of the key), (3) If the ratchet key is a first-generation ratchet key, a third temporary public key needs to be included (additional).
程序P62(見圖5之步驟S57):伺服器c接收到訊息密文後,檢查帳號公鑰是否有效。若此帳號公鑰為有效,則伺服器c回應帳號公鑰為有 效之相關資訊(如正確或成功)予終端a1(如發訊終端),並儲存訊息密文;反之,若帳號公鑰為無效,則伺服器c回應帳號公鑰為無效之相關資訊(如錯誤或失敗)予終端a1(如發訊終端)。 Program P62 (see step S57 in Figure 5): After receiving the message ciphertext, server c checks whether the account public key is valid. If the account public key is valid, server c responds that the account public key is valid. Valid relevant information (such as correct or successful) is sent to terminal a1 (such as the sending terminal), and the message ciphertext is stored; on the contrary, if the account public key is invalid, server c responds with relevant information that the account public key is invalid (such as error or failure) to terminal a1 (such as the sending terminal).
程序P63(見圖5之步驟S58):終端a2、新終端b1或新終端b2(如收訊終端)上線後,從伺服器c收到各自對應之訊息密文(加密訊息)。 Procedure P63 (see step S58 in Figure 5): After the terminal a2, the new terminal b1 or the new terminal b2 (such as the receiving terminal) comes online, the corresponding message ciphertext (encrypted message) is received from the server c.
程序P64(見圖5之步驟S59):終端a2、新終端b1或新終端b2(如收訊終端)衍生對應之棘輪金鑰。例如,由新終端b1或新終端b2(如收訊終端)運算下列公式:,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定以使用終端a1(如發訊終端)之第三臨時公鑰與第二帳號b(如收訊帳號)之帳號私鑰計算出對應之棘輪金鑰。此外,由終端a2(如收訊終端)運算下列公式: ,亦即依據橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定以使用終端a1(如發訊終端)之第三臨時公鑰與第一帳號a之帳號私鑰計算出對應之棘輪金鑰。 Program P64 (see step S59 in Figure 5): Terminal a2, new terminal b1 or new terminal b2 (such as the receiving terminal) derives the corresponding ratchet key. For example, the following formula is calculated by the new terminal b1 or new terminal b2 (such as the receiving terminal): , that is, based on the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol to use the third temporary public key of terminal a1 (such as the sending terminal) and the account private key of the second account b (such as the receiving account) Calculate the corresponding ratchet key . In addition, the terminal a2 (such as the receiving terminal) calculates the following formula: , that is, based on the Elliptic Curve Diffie-Hellman Key Exchange (ECDH) protocol to use the third temporary public key of terminal a1 (such as the sending terminal) and the account private key of the first account a Calculate the corresponding ratchet key .
程序P65(見圖5之步驟S59):終端a2、新終端b1或新終端b2(如收訊終端)使用第一常數或第二常數解密訊息(訊息密文)。例如,由新終端b1或新終端b2(如收訊終端)運算下列三個公式: ,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第一常數(如0x1)將棘輪金鑰(如第一代棘輪金鑰)衍生為訊息金鑰(如第一代訊息金鑰)。 ,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第二常數(如0x2)將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰 (如第二代棘輪金鑰)。CT_Messagea1_b),亦即透過進階加密標準(AES)演算法以使用訊息金鑰(如第一代訊息金鑰)與訊息密文CT_Messagea1_b解密出訊息Message。 Procedure P65 (see step S59 in Figure 5): The terminal a2, the new terminal b1 or the new terminal b2 (such as the receiving terminal) uses the first constant or the second constant to decrypt the message (message ciphertext). For example, the following three formulas are calculated by the new terminal b1 or new terminal b2 (such as the receiving terminal): , that is, using the key hash message authentication code (HMAC) and the first constant (such as 0x1) to convert the ratchet key (such as the first generation ratchet key) is derived as a message key (Such as the first generation message key). , that is, using the key hash message authentication code (HMAC) and the second constant (such as 0x2) to convert the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key). CT_Message a1_b ), that is, using the message key through the Advanced Encryption Standard (AES) algorithm (such as the first-generation message key) and the message ciphertext CT_Message a1_b to decrypt the message Message.
此外,由終端a2(如收訊終端)運算下列三個公式:,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第一常數(如0x1)將棘輪金鑰(如第一代棘輪金鑰)衍生為訊息金鑰(如第一代訊息金鑰)。 ,亦即使用金鑰雜湊訊息認證碼(HMAC)配合第二常數(如0x2)將棘輪金鑰(如第一代棘輪金鑰)更新成下一代棘輪金鑰(如第二代棘輪金鑰)。Message=AESdecrypt ,亦即透過進階加密標準(AES)演算法以使用訊息金鑰(如第一代訊息金鑰)與訊息密文CT_Messagea1_a解密出訊息Message。 In addition, the following three formulas are calculated by terminal a2 (such as the receiving terminal): , that is, using the key hash message authentication code (HMAC) and the first constant (such as 0x1) to convert the ratchet key (such as the first generation ratchet key) is derived as a message key (Such as the first generation message key). , that is, using the key hash message authentication code (HMAC) and the second constant (such as 0x2) to convert the ratchet key (such as the first generation ratchet key) updated to the next generation ratchet key (Such as the second generation ratchet key). Message=AES decrypt , that is, using the message key through the Advanced Encryption Standard (AES) algorithm (such as the first-generation message key) and the message ciphertext CT_Message a1_a to decrypt the message Message.
再者,本發明還提供一種針對多終端之端對端加密通訊方法之電腦可讀媒介,係應用於具有處理器及/或記憶體之計算裝置或電腦中,且電腦可讀媒介儲存有語音指令,並可利用計算裝置或電腦透過處理器及/或記憶體執行電腦可讀媒介,以於執行電腦可讀媒介時執行上述內容。 Furthermore, the present invention also provides a computer-readable medium for an end-to-end encrypted communication method for multiple terminals, which is applied to a computing device or computer with a processor and/or memory, and the computer-readable medium stores a voice message. instructions, and can utilize a computing device or computer to execute the computer-readable medium through a processor and/or memory to execute the above content when the computer-readable medium is executed.
在一實施例中,處理器可為微處理器、中央處理器(CPU)、圖形處理器(GPU)、微控制器(MCU)等,記憶體可為隨機存取記憶體(RAM)、唯讀記憶體(ROM)、記憶卡、硬碟(如雲端/網路/外接式硬碟)、光碟、隨身碟、資料庫等,且計算裝置或電腦可為計算機、平板電腦、個人電腦、筆記型電腦、 桌上型電腦、伺服器(如雲端/遠端/網路伺服器)、智慧型手機等,但不以此為限。 In one embodiment, the processor may be a microprocessor, a central processing unit (CPU), a graphics processing unit (GPU), a microcontroller (MCU), etc., and the memory may be a random access memory (RAM), a unique memory (RAM), or a random access memory (RAM). Read memory (ROM), memory card, hard drive (such as cloud/network/external hard drive), optical disk, pen drive, database, etc., and the computing device or computer can be a computer, tablet, personal computer, notebook type computer, Desktop computers, servers (such as cloud/remote/network servers), smartphones, etc., but are not limited to this.
綜上,本發明之多終端之端對端加密通訊方法及電腦可讀媒介至少具有下列特色、優點或技術功效。 In summary, the multi-terminal end-to-end encrypted communication method and computer-readable medium of the present invention have at least the following features, advantages or technical effects.
一、本發明於使用者擁有多個終端(如發訊終端/收訊終端)時,使用者可以同時使用多個終端發送與接收訊息密文(加密訊息),且各終端間之訊息可以保持一致。 1. When the user owns multiple terminals (such as a sending terminal/receiving terminal), the user can simultaneously use multiple terminals to send and receive message ciphertext (encrypted messages), and the messages between the terminals can be maintained. consistent.
二、本發明能使各終端間具有訊息之一致性,以利使用者使用任一終端發送或接收一則訊息時,使用者之其餘終端能自動同步此則訊息。 2. The present invention enables message consistency between terminals, so that when a user uses any terminal to send or receive a message, the user's other terminals can automatically synchronize the message.
三、本發明能透過使用者之多個(所有)終端擁有一對相同之帳號金鑰對,以利達成使用者之終端之數量增加時,不會增加發送訊息密文(加密訊息)之數量。 3. The present invention enables multiple (all) user terminals to have the same account key pair, so that when the number of user terminals increases, the number of message ciphertexts (encrypted messages) sent will not increase. .
四、本發明利用同一使用者之多個終端共享同一帳號金鑰對,當終端(如發訊終端)發送訊息時,終端與收訊帳號之帳號公鑰進行金鑰交換,隨後使用棘輪金鑰衍生出訊息金鑰以進行訊息之加密,此訊息便能被收訊帳號之多個(所有)終端解密,有利於達到終端對帳號之端對端加密,且終端所傳送之訊息密文(加密訊息)之數量不會受到使用者之終端之數量增加而增加。 4. The present invention uses multiple terminals of the same user to share the same account key pair. When the terminal (such as the sending terminal) sends a message, the terminal performs key exchange with the account public key of the receiving account, and then uses the ratchet key. The message key is derived to encrypt the message. This message can be decrypted by multiple (all) terminals of the receiving account, which is conducive to end-to-end encryption of the account by the terminal, and the ciphertext of the message sent by the terminal (encrypted The number of messages) will not increase as the number of user terminals increases.
五、本發明之發訊終端可以只需傳送一則訊息密文(加密訊息),便能使收訊帳號下之多個(所有)終端都可以解密此訊息密文(加密訊息)。 5. The sending terminal of the present invention can only send one message ciphertext (encrypted message), so that multiple (all) terminals under the receiving account can decrypt the message ciphertext (encrypted message).
六、本發明之訊息金鑰皆由多個終端之間協商產生,可以不必上傳訊息金鑰至伺服器,亦可以不使用任何形式加密傳送訊息金鑰。 6. The message key of the present invention is generated through negotiation between multiple terminals. There is no need to upload the message key to the server, and the message key does not need to be encrypted in any form.
七、本發明能於使用者異動終端時,透過帳號金鑰對之更新及 同步機制,以利達成終端之異動後仍具有端對端加密之保護。 7. The present invention can update the account key pair when the user changes the terminal and Synchronization mechanism to achieve end-to-end encryption protection even after the terminal changes.
八、當使用者進行終端之異動時,本發明能透過帳號金鑰對之更新來確保端對端加密之安全性,使新終端可以收到並解密新的訊息密文(加密訊息),而被移除之終端則無法收到且無法解密新的訊息。 8. When the user changes the terminal, the present invention can ensure the security of end-to-end encryption by updating the account key pair, so that the new terminal can receive and decrypt the new message ciphertext (encrypted message), and The removed terminal cannot receive and decrypt new messages.
九、當使用者進行終端之異動時,本發明之終端會進行帳號金鑰對之更新,並進行使用者之其餘終端之同步與更新,以利確保各終端之帳號金鑰對一致。 9. When the user changes the terminal, the terminal of the present invention will update the account key pair and synchronize and update the user's other terminals to ensure that the account key pairs of each terminal are consistent.
十、本發明能利用棘輪金鑰(棘輪方式)產生訊息金鑰,以利確保訊息或訊息金鑰之前向安全或前向保密(FS)。 10. The present invention can use a ratchet key (ratchet method) to generate a message key to ensure forward security or forward secrecy (FS) of the message or message key.
十一、本發明之訊息加密所使用之訊息金鑰透過單向性之雜湊函數(如金鑰雜湊訊息認證碼HMAC)來產生,故即便有第三者(如駭客)取得了當代之訊息金鑰,也無法逆推出先前(如前代)之訊息金鑰,以利保有訊息或訊息金鑰之前向安全或前向保密(FS)。 11. The message key used in the message encryption of the present invention is generated through a one-way hash function (such as the key hash message authentication code HMAC), so even if a third party (such as a hacker) obtains contemporary messages The key cannot be reversely deduced from the previous (such as the previous generation) message key, so as to maintain the forward security or forward secrecy (FS) of the message or message key.
十二、本發明之同一使用者之多個(所有)終端可以擁有一對相同之帳號金鑰對,當有終端要發送訊息時,能使用橢圓曲線迪菲-赫爾曼金鑰交換(ECDH)協定與金鑰棘輪之方式,對臨時私鑰與收訊帳號之帳號公鑰進行運算出訊息金鑰來加密訊息,以利發送訊息密文(加密訊息)之數量不受使用者之終端之數量影響,亦能保有訊息或訊息金鑰之前向安全或前向保密(FS)。 12. Multiple (all) terminals of the same user of the present invention can have the same account key pair. When a terminal wants to send a message, Elliptic Curve Diffie-Hellman Key Exchange (ECDH) can be used. ) protocol and key ratchet method, the temporary private key and the account public key of the receiving account are calculated to obtain the message key to encrypt the message, so that the number of sent message ciphertext (encrypted message) is not affected by the user's terminal Affected by quantity, forward security or forward secrecy (FS) of messages or message keys can also be maintained.
上述實施形態僅例示性說明本發明之原理、特點及其功效,並非用以限制本發明之可實施範疇,任何熟習此項技藝之人士均能在不違背本發明之精神及範疇下,對上述實施形態進行修飾與改變。任何使用本發明所揭示內容而完成之等效改變及修飾,均仍應為申請專利範圍所涵蓋。因此, 本發明之權利保護範圍應如申請專利範圍所列。 The above embodiments are only illustrative of the principles, characteristics and effects of the present invention, and are not intended to limit the scope of the present invention. Anyone skilled in the art can make the above-mentioned modifications without violating the spirit and scope of the present invention. Modify and change the implementation form. Any equivalent changes and modifications made using the contents disclosed in the present invention shall still be covered by the patent application. therefore, The scope of protection of the rights of the present invention shall be as listed in the patent application scope.
S51至S59:步驟 S51 to S59: Steps
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112108749A TWI835580B (en) | 2023-03-09 | 2023-03-09 | Multiple terminal end-to-end encryption communication method and computer readable medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW112108749A TWI835580B (en) | 2023-03-09 | 2023-03-09 | Multiple terminal end-to-end encryption communication method and computer readable medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI835580B true TWI835580B (en) | 2024-03-11 |
| TW202437736A TW202437736A (en) | 2024-09-16 |
Family
ID=91269657
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW112108749A TWI835580B (en) | 2023-03-09 | 2023-03-09 | Multiple terminal end-to-end encryption communication method and computer readable medium |
Country Status (1)
| Country | Link |
|---|---|
| TW (1) | TWI835580B (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109905236A (en) * | 2019-01-15 | 2019-06-18 | 如般量子科技有限公司 | Anti- quantum calculation Elgamal encryption and decryption method and system based on private key pond |
| JP2022519688A (en) * | 2019-02-05 | 2022-03-24 | クリプト,インコーポレイテッド | End-to-end double ratchet encryption with epoch key exchange |
| TWI761243B (en) * | 2021-06-29 | 2022-04-11 | 中華電信股份有限公司 | Encryption system and encryption method for group instant massaging |
-
2023
- 2023-03-09 TW TW112108749A patent/TWI835580B/en active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109905236A (en) * | 2019-01-15 | 2019-06-18 | 如般量子科技有限公司 | Anti- quantum calculation Elgamal encryption and decryption method and system based on private key pond |
| JP2022519688A (en) * | 2019-02-05 | 2022-03-24 | クリプト,インコーポレイテッド | End-to-end double ratchet encryption with epoch key exchange |
| TWI761243B (en) * | 2021-06-29 | 2022-04-11 | 中華電信股份有限公司 | Encryption system and encryption method for group instant massaging |
Also Published As
| Publication number | Publication date |
|---|---|
| TW202437736A (en) | 2024-09-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12010216B2 (en) | Computer-implemented system and method for highly secure, high speed encryption and transmission of data | |
| US12284270B2 (en) | Systems and methods for providing signatureless, confidential and authentication of data during handshake for classical and quantum computing environments | |
| US10230524B2 (en) | Securely transferring user information between applications | |
| CN107005413B (en) | Efficient initiation of secure connections and related services | |
| US11533297B2 (en) | Secure communication channel with token renewal mechanism | |
| US7502927B2 (en) | Directory enabled secure multicast group communications | |
| CN114244508B (en) | Data encryption method, device, equipment and storage medium | |
| US7979707B2 (en) | Secure seed generation protocol | |
| US20220131838A1 (en) | End-to-end double-ratchet encryption with epoch key exchange | |
| JP7451738B2 (en) | Key update method and related devices | |
| CN112104454B (en) | Data secure transmission method and system | |
| US11528127B2 (en) | Computer-implemented system and method for highly secure, high speed encryption and transmission of data | |
| CN115459913A (en) | Quantum key cloud platform-based link transparent encryption method and system | |
| CN111294349A (en) | Method and device for sharing data of Internet of things equipment | |
| CN116233767B (en) | Cluster intercom communication method, device, equipment and storage medium | |
| Xu et al. | A computationally efficient authentication and key agreement scheme for multi-server switching in WBAN | |
| CN115514473A (en) | Method, system, device and storage medium for secure data communication | |
| CN119583061A (en) | Post-quantum key negotiation method and device | |
| TWI761243B (en) | Encryption system and encryption method for group instant massaging | |
| TW202437736A (en) | Multiple terminal end-to-end encryption communication method and computer readable medium | |
| CN116156491B (en) | Group Anonymous Authentication Method Based on Wireless Body Area Network | |
| CN100596066C (en) | A Method of Entity Authentication Based on H323 System | |
| US20240048385A1 (en) | Sharing cryptographic material | |
| JP2003338812A (en) | Encryption system | |
| US20250260557A1 (en) | End to end encryption with roaming capabilities |



















































































































































































