CN103795524B - Dynamic SMS encryption based on 3DES, decryption method - Google Patents

Dynamic SMS encryption based on 3DES, decryption method Download PDF

Info

Publication number
CN103795524B
CN103795524B CN201410034009.4A CN201410034009A CN103795524B CN 103795524 B CN103795524 B CN 103795524B CN 201410034009 A CN201410034009 A CN 201410034009A CN 103795524 B CN103795524 B CN 103795524B
Authority
CN
China
Prior art keywords
key
short message
content
message
3des
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410034009.4A
Other languages
Chinese (zh)
Other versions
CN103795524A (en
Inventor
赵晓慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wingtech Communication Co Ltd
Original Assignee
Wingtech Communication Co Ltd
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 Wingtech Communication Co Ltd filed Critical Wingtech Communication Co Ltd
Priority to CN201410034009.4A priority Critical patent/CN103795524B/en
Publication of CN103795524A publication Critical patent/CN103795524A/en
Application granted granted Critical
Publication of CN103795524B publication Critical patent/CN103795524B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Storage Device Security (AREA)

Abstract

Present invention is disclosed a kind of dynamic SMS encryption based on 3DES, decryption method, the encryption method comprises the following steps:3 key key are dynamically got according to the time of transmission short message, sender's phone number, recipient's phone number;The Content Transformation of information will be sent into Unicode codes, be grouped in units of N positions, be filled in group less than N positions with PKCS7Padding mode;Based on 3 key obtained in above-mentioned steps, the content after being changed to information to form ciphertext using 3DES algorithms to being encrypted.Dynamic SMS encryption proposed by the present invention based on 3DES, decryption method; the public key of other side is uploaded and obtained without server; consult cipher mode or key without both sides; key is dynamically generated using each opportunity for sending short message; easy and effective, randomness is high, also is difficult to crack out content even if short message is stolen or intercepted; privacy degrees are improved, are effectively protected the privacy of user.

Description

Dynamic SMS encryption based on 3DES, decryption method
Technical field
The invention belongs to communication technique field, is related to a kind of information ciphering method, more particularly to a kind of dynamic based on 3DES State message encryption method;Meanwhile the invention further relates to a kind of dynamic short message decryption method based on 3DES.
Background technology
The popularization of smart mobile phone brings facility to our life, and people are more and more personal by sending and receiving short messages Information and various business informations, but the problem of these message are often faced with security, for example steal, intercept.
In view of this, nowadays there is an urgent need to design a kind of new information ciphering method, to overcome existing information sender The drawbacks described above of formula.
The content of the invention
The technical problems to be solved by the invention are:A kind of dynamic message encryption method based on 3DES is provided, it can be ensured that The security of information transfer.
In addition, the present invention also provides a kind of dynamic short message decryption method based on 3DES, it can be ensured that the safety of information transfer Property.
In order to solve the above technical problems, the present invention adopts the following technical scheme that:
A kind of dynamic message encryption method based on 3DES, the encryption method comprise the following steps:
Step S11,3 are dynamically got according to the time of transmission short message, sender's phone number, recipient's phone number Individual key key;
Step S12, the Content Transformation of information will be sent into Unicode codes, be grouped in units of N positions, in group not Sufficient N positions are filled with PKCS7Padding mode;
Step S13, based on 3 key obtained in step S11, the content after being changed to information is using 3DES algorithms to entering Row encryption forms ciphertext.
As a preferred embodiment of the present invention, the encryption method specifically comprises the following steps:
Step S101, editing short message content, short message sending pattern is selected, if selection ciphertext transfer mode, performs step S102 to S105;
Step S102,3 key of dynamic generation, the date first key k1 on the same day is obtained;The phone number of sender is taken to make For the second key k2, the method for being added remainder by from left to right adjacent bit if number is more than 8 is changed to obtain one 8 Number, it is filled if number is less than 8 with PKCS7Padding mode;The cell-phone number of recipient is taken with same method Code is used as the 3rd key k3;
Step S103, short message content is converted to the form of Unicode codes, DES algorithms are the data progress with 64 Processing, so being that content of short message is divided into several groups by unit by 64, if the data deficiencies 64 of last group, is used PKCS7Padding mode is filled, the total amount of byte that the syllabified code each filled is filled out;
Step S104, short message content packet is encrypted with 3DES, encryption formula is:msg=Ek3(Dk2(Ek1 (msg) des encryption generation first message msg1), i.e., is first carried out with first key k1 to message content msg, then with the second key K2 carries out DES decryption the second message m sg2 of generation to first message msg1, and finally the second message m sg2 is entered with the 3rd key k3 Row des encryption generates final ciphertext msg3;
Step S105, sent final ciphertext msg3 as content of short message.
A kind of dynamic short message decryption method based on 3DES, it is characterised in that the decryption method comprises the following steps:
Step S21, according to receive short message opportunity and sender, the phone number of recipient dynamically get 3 it is close Key key;
Step S22, based on 3 key obtained in step S21,3DES algorithms are used to solving to the ciphertext received It is close to be formed in plain text;
Step S23, each group is converted into corresponding text information from Unicode codes in plain text, combines and remove last fill out Fill information and obtain final plaintext short message.
As a preferred embodiment of the present invention, short message step S201, is received, judges whether it is ciphertext pattern, if It is to perform step S202;
Step S202, the information content to be decrypted is chosen whether by prompting, if performing step S203 to step S205;
Step S203,3 key of dynamic generation, the date first key k1 on the same day is obtained;The phone number of sender is taken to make For the second key k2, the method for being added remainder by from left to right adjacent bit if number is more than 8 is changed to obtain one 8 Number, it is filled if number is less than 8 with PKCS7Padding mode;The cell-phone number of recipient is taken with same method Code is used as the 3rd key k3;
Step S204, short message content is decrypted with 3DES algorithms, decryption formula is msg=Dk1 (EK2 (Dk3 (msg) DES decryption the 4th message m sg4 of generation)), i.e., are first carried out with the 3rd key k3 to message content msg, then with the second key K2 carries out des encryption to msg1 and generates the 5th message m sg5, finally carries out DES decryption to the 5th message m sg5 with first key k1 Generate final plaintext msg3;
Step S205, each group is converted into corresponding text information from Unicode codes in plain text, combines and remove last fill out Fill information and obtain final plaintext short message.
The beneficial effects of the present invention are:Dynamic SMS encryption proposed by the present invention based on 3DES, decryption method, without The public key of other side is uploaded and obtained by server, consults cipher mode or key without both sides, utilizes each transmission short message Opportunity is dynamically generated key, easy and effective, and randomness is high, also is difficult to crack out content even if short message is stolen or intercepted, Privacy degrees are improved, are effectively protected the privacy of user.
The present invention obtains 3 dynamic key by the opportunity and sender, recipient's number that send short message first in transmitting terminal; Then short message content is changed and is grouped;Short message content packet is encrypted using 3DES methods afterwards;Finally The ciphertext obtained after encryption is transmitted as short message content.3 dynamic key are obtained in the same way in receiving terminal; Then ciphertext block is decrypted using 3DES methods;Afterwards by the information combination transformational analysis of each group;After finally decrypting Obtained plaintext is shown.
Brief description of the drawings
Fig. 1 is the process that the information content is encrypted transmitting terminal.
Fig. 2 is the process that transmitting terminal is encrypted using 3 key of dynamic generation.
Fig. 3 is the process that the information content is decrypted receiving terminal.
Fig. 4 is the process that receiving terminal is decrypted using 3 key of dynamic generation.
Embodiment
The preferred embodiment that the invention will now be described in detail with reference to the accompanying drawings.
Embodiment one
The present invention obtains 3 dynamic key by the opportunity and sender, recipient's number that send short message first in transmitting terminal; Then short message content is changed and is grouped;Short message content packet is encrypted using 3DES methods afterwards;Finally The ciphertext obtained after encryption is transmitted as short message content.3 dynamic key are obtained in the same way in receiving terminal; Then ciphertext block is decrypted using 3DES methods;Afterwards by the information combination transformational analysis of each group;After finally decrypting Obtained plaintext is shown.
Present invention is disclosed a kind of dynamic message encryption method based on 3DES, the encryption method comprises the following steps:
Step S11,3 are dynamically got according to the time of transmission short message, sender's phone number, recipient's phone number Individual key key;
Step S12, the Content Transformation of information will be sent into Unicode codes, with N positions(Such as 64)Divided for unit Group, less than N positions in group(Such as 64)Be filled with PKCS7Padding mode;
Step S13, based on 3 key obtained in step S11, the content after being changed to information is using 3DES algorithms to entering Row encryption forms ciphertext.
Specifically, referring to Fig. 1, the dynamic message encryption method based on 3DES comprises the following steps:
【Step A】Editing short message content, short message sending pattern is selected, if selection ciphertext transfer mode, performs step B extremely E;
【Step B】3 key of dynamic generation, obtain the date on the same day(The day on the same day is taken in view of the possibility of short message delay Phase rather than specifically send the time)As " 20131130 " are used as first key k1;The phone number of sender is taken as second Key k2, the method for being added remainder by from left to right adjacent bit if number is more than 8 are changed to obtain 8 digits (such as 9 Number 123456789 then according to said method performs a 1+2,2+3,3+4,4+5,5+6,6+7,7+8,8+9 and takes units to obtain 35791357), it is filled if number is less than 8 with PKCS7Padding mode(Cover is if 12345 12345333);The phone number for taking recipient by the use of same method is used as the 3rd key k3;Certainly, the digit of key can also , not necessarily can only be 8 for other.
【Step C】Short message content is converted to the form of Unicode codes, because DES algorithms are the data progress with 64 Processing, so to be that content of short message is divided into several groups by unit by 64, if the data deficiencies 64 of last group, is used PKCS7Padding mode is filled, the total amount of byte that the syllabified code each filled is filled out, and such as " hello ", is write as 16 System position { 68,65,6C, 6C, 6F }, it is after filling { 68,65,6C, 6C, 6F, 03,03,03 };
【Step D】Short message content packet is encrypted (such as Fig. 2) with 3DES, encryption formula is:msg=Ek3(Dk2 (Ek1 (msg)), i.e., des encryption generation msg1 is first carried out with k1 to message content msg, then with k2 msg1 is carried out DES solve it is dense Into msg2, des encryption is finally carried out to msg2 with k3 and generates final ciphertext msg3;
【Step E】Sent final ciphertext msg3 as content of short message.
The present invention also discloses a kind of dynamic short message decryption method based on 3DES, and the decryption method comprises the following steps:
Step S21, according to receive short message opportunity and sender, the phone number of recipient dynamically get 3 it is close Key key;
Step S22, based on 3 key obtained in step S21,3DES algorithms are used to solving to the ciphertext received It is close to be formed in plain text;
Step S23, each group is converted into corresponding text information from Unicode codes in plain text, combines and remove last fill out Fill information and obtain final plaintext short message.
Referring to Fig. 3, the decryption in receiving terminal specifically includes following steps:
【Step F】Short message is received, judges whether it is ciphertext pattern, if performing step G;
【Step G】The information content to be decrypted is chosen whether by prompting, if performing step H to J;
【Step H】3 key are obtained with mode dynamic same in transmitting terminal step B;
【Step I】Short message content is decrypted (such as Fig. 4) with 3DES algorithms, decryption formula is msg=Dk1 (EK2 (Dk3 (msg))), i.e., DES decryption generation msg1 are first carried out to message content msg with k3, then des encryption is carried out to msg1 with k2 Msg2 is generated, DES decryption is finally carried out to msg2 with k1 and generates final plaintext msg3;
【Step J】Each group is converted into corresponding text information from Unicode codes in plain text, combines and removes last filling Information obtains final plaintext short message.
In summary, the dynamic SMS encryption proposed by the present invention based on 3DES, decryption method, without on server The public key of other side is passed and obtained, consults cipher mode or key without both sides, is dynamically given birth to using each opportunity for sending short message Easy and effective into key, randomness is high, also is difficult to crack out content even if short message is stolen or intercepted, improves secrecy journey Degree, it is effectively protected the privacy of user.
Here description of the invention and application are illustrative, are not wishing to limit the scope of the invention to above-described embodiment In.The deformation and change of embodiments disclosed herein are possible, real for those skilled in the art The replacement and equivalent various parts for applying example are known.It should be appreciated by the person skilled in the art that the present invention is not being departed from Spirit or essential characteristics in the case of, the present invention can in other forms, structure, arrangement, ratio, and with other components, Material and part are realized.In the case where not departing from scope and spirit of the present invention, embodiments disclosed herein can be entered The other deformations of row and change.

Claims (2)

1. a kind of dynamic message encryption method based on 3DES, it is characterised in that the encryption method comprises the following steps:
Step S11, according to send time of short message, sender's phone number, recipient's phone number dynamically get 3 it is close Key key;
Step S12, the Content Transformation of information will be sent into Unicode codes, be grouped in units of N positions, less than N positions in group Be filled with PKCS7Padding mode;
Step S13, based on 3 key obtained in step S11, the content after being changed to information is using 3DES algorithms to adding Close formation ciphertext;
The encryption method specifically comprises the following steps:
Step S101, editing short message content, short message sending pattern is selected, if selection ciphertext transfer mode, performs step S102 To S105;
Step S102,3 key of dynamic generation, the date first key k1 on the same day is obtained;The phone number of sender is taken as Two key k2, the method for being added remainder by from left to right adjacent bit if number is more than 8 are changed to obtain 8 digits, such as Fruit number is less than 8 to be then filled with PKCS7Padding mode;The phone number for taking recipient with same method is made For the 3rd key k3;
Step S103, short message content is converted to the form of Unicode codes, DES algorithms are handled with the data of 64 , so being that content of short message is divided into several groups by unit by 64, if the data deficiencies 64 of last group, is used PKCS7Padding mode is filled, the total amount of byte that the syllabified code each filled is filled out;
Step S104, short message content packet is encrypted with 3DES, encryption formula is:Msg=Ek3 (Dk2 (Ek1 (msg) des encryption generation first message msg1), i.e., is first carried out with first key k1 to message content msg, then with the second key K2 carries out DES decryption the second message m sg2 of generation to first message msg1, and finally the second message m sg2 is entered with the 3rd key k3 Row des encryption generates final ciphertext msg3;
Step S105, sent final ciphertext msg3 as content of short message.
2. a kind of dynamic short message decryption method based on 3DES, it is characterised in that the decryption method comprises the following steps:
Step S21, according to receive time of short message, sender's phone number, recipient's phone number dynamically get 3 it is close Key key;
Step S22, based on 3 key obtained in step S21,3DES algorithms are used to shape is decrypted to the ciphertext received Into in plain text;
Step S23, each group is converted into corresponding text information from Unicode codes in plain text, combines and remove last filling letter Breath obtains final plaintext short message;
The decryption method specifically comprises the following steps:
Step S201, short message is received, judges whether it is ciphertext pattern, if performing step S202;
Step S202, the information content to be decrypted is chosen whether by prompting, if performing step S203 to step S205;
Step S203,3 key of dynamic generation, the date first key k1 on the same day is obtained;The phone number of sender is taken as Two key k2, the method for being added remainder by from left to right adjacent bit if number is more than 8 are changed to obtain 8 digits, such as Fruit number is less than 8 to be then filled with PKCS7Padding mode;The phone number for taking recipient with same method is made For the 3rd key k3;
Step S204, short message content is decrypted with 3DES algorithms, decryption formula is msg=Dk1 (EK2 (Dk3 (msg) DES decryption the 4th message m sg4 of generation)), i.e., are first carried out with the 3rd key k3 to message content msg, then with the second key K2 carries out des encryption to msg1 and generates the 5th message m sg5, finally carries out DES decryption to the 5th message m sg5 with first key k1 Generate final plaintext msg3;
Step S205, each group is converted into corresponding text information from Unicode codes in plain text, combines and remove last filling letter Breath obtains final plaintext short message.
CN201410034009.4A 2014-01-24 2014-01-24 Dynamic SMS encryption based on 3DES, decryption method Active CN103795524B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410034009.4A CN103795524B (en) 2014-01-24 2014-01-24 Dynamic SMS encryption based on 3DES, decryption method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410034009.4A CN103795524B (en) 2014-01-24 2014-01-24 Dynamic SMS encryption based on 3DES, decryption method

Publications (2)

Publication Number Publication Date
CN103795524A CN103795524A (en) 2014-05-14
CN103795524B true CN103795524B (en) 2017-11-28

Family

ID=50670860

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410034009.4A Active CN103795524B (en) 2014-01-24 2014-01-24 Dynamic SMS encryption based on 3DES, decryption method

Country Status (1)

Country Link
CN (1) CN103795524B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104363584B (en) * 2014-11-27 2018-06-15 宇龙计算机通信科技(深圳)有限公司 A kind of method, apparatus and terminal of short message Encrypt and Decrypt
CN104640091B (en) * 2015-01-13 2019-10-18 董红伟 A kind of SMS encryption communication method
CN106302514A (en) * 2016-09-06 2017-01-04 苏州协鑫集成科技工业应用研究院有限公司 The dynamic encrypting method of memory card and decryption method and device thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626567A (en) * 2009-06-29 2010-01-13 深圳华为通信技术有限公司 Short message sending and receiving method, short message sending and receiving device and mobile terminal
CN101820593A (en) * 2009-06-04 2010-09-01 岳曙光 Intelligent SIM card and method for realizing transmission and processing of data short message through same
CN102448033A (en) * 2011-11-24 2012-05-09 中国钓具技术标准化(北仑海伯)研究中心 Short message security certification method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101820593A (en) * 2009-06-04 2010-09-01 岳曙光 Intelligent SIM card and method for realizing transmission and processing of data short message through same
CN101626567A (en) * 2009-06-29 2010-01-13 深圳华为通信技术有限公司 Short message sending and receiving method, short message sending and receiving device and mobile terminal
CN102448033A (en) * 2011-11-24 2012-05-09 中国钓具技术标准化(北仑海伯)研究中心 Short message security certification method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
3DES算法原理与设计;邓悦恒;《电脑知识与技术》;20110731;第7卷(第20期);第1页 *

Also Published As

Publication number Publication date
CN103795524A (en) 2014-05-14

Similar Documents

Publication Publication Date Title
CN101789865B (en) Dedicated server used for encryption and encryption method
CN101188496B (en) A SMS encryption transport method
CN101197674B (en) Encrypted communication method, server and encrypted communication system
CN101720071B (en) Short message two-stage encryption transmission and secure storage method based on safety SIM card
CN106533656B (en) A kind of key multilayer mixing method for encryption/decryption based on WSN
CN108111306A (en) A kind of communication means between power distribution automation main station and distribution power automation terminal
US6640303B1 (en) System and method for encryption using transparent keys
CN104052601A (en) Secret key isolation signcryption method
CN102740239A (en) Method and system for secure transmission of media information
CN103167494B (en) Method for sending information and system
CN105792190A (en) Data encryption, decryption and transmission method in communication system
CN101374251B (en) Method for encrypting short message and used terminal equipment thereof
CN103179514A (en) Cell phone safe group-sending method and device for sensitive message
CN104253691A (en) Logistics information transmission method, device and system
CN103795524B (en) Dynamic SMS encryption based on 3DES, decryption method
CN104602208B (en) A kind of SMS encryption communication means based on mobile network
CN102572750A (en) Method and terminal for protecting short messages
CN102958021A (en) Short message encryption and decryption communication system and communication method thereof
CN107659405B (en) The encrypting and decrypting method of data communication between a kind of substation boss station
CN103945348A (en) Asymmetrical secret key short message encryption method and system
CN103916834A (en) Short message encryption method and system allowing user to have exclusive secret key
CN102036194B (en) Method and system for encrypting MMS
KR101760376B1 (en) Terminal and method for providing secure messenger service
CN103384233B (en) A kind of methods, devices and systems for acting on behalf of conversion
CN101262340A (en) MMS encryption method and mobile terminal for transmitting and receiving encrypted MMS

Legal Events

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