[go: up one dir, main page]

CN106211108A - A kind of message encryption method based on RSA PKI - Google Patents

A kind of message encryption method based on RSA PKI Download PDF

Info

Publication number
CN106211108A
CN106211108A CN201610550887.0A CN201610550887A CN106211108A CN 106211108 A CN106211108 A CN 106211108A CN 201610550887 A CN201610550887 A CN 201610550887A CN 106211108 A CN106211108 A CN 106211108A
Authority
CN
China
Prior art keywords
public key
certificate
communication entity
short message
message
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.)
Pending
Application number
CN201610550887.0A
Other languages
Chinese (zh)
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.)
Xian University of Posts and Telecommunications
Original Assignee
Xian University of Posts and Telecommunications
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 Xian University of Posts and Telecommunications filed Critical Xian University of Posts and Telecommunications
Priority to CN201610550887.0A priority Critical patent/CN106211108A/en
Publication of CN106211108A publication Critical patent/CN106211108A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements
    • H04W4/14Short messaging services, e.g. short message services [SMS] or unstructured supplementary service data [USSD]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0442Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • H04L63/123Applying verification of the received information received data contents, e.g. message integrity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/02Protecting privacy or anonymity, e.g. protecting personally identifiable information [PII]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/10Integrity

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明公开了一种基于RSA公钥的短信加密方法,包括:通信实体通过第三方CA获得个人的数字证书和对应的私钥;通信实体对自己的身份与公钥证书和私钥进行绑定操作,指定证书的信任根;通信实体与对等通信实体进行沟通,指定对等通信实体的公钥证书,对对等通信实体的公钥信息与身份信息进行一一对应,对等通信实体会向原通信实体返回公钥证书信息,拿到该证书后,将对等通信实体信息与证书作一一映射;通信实体用对等通信实体的证书对短信进行RSA公钥加密,将加密后的短信通过经典信道传送至通信实体;对等通信实体接收到信息之后,输入RSA私钥保护口令,将发送方发送的明文进行恢复。

The invention discloses a short message encryption method based on an RSA public key, comprising: a communication entity obtains a personal digital certificate and a corresponding private key through a third-party CA; the communication entity binds its own identity with the public key certificate and the private key Operation, specify the trust root of the certificate; communicate with the peer communication entity, specify the public key certificate of the peer communication entity, and make a one-to-one correspondence between the public key information and identity information of the peer communication entity, and the peer communication entity will Return the public key certificate information to the original communication entity. After obtaining the certificate, map the information of the peer communication entity and the certificate one by one; the communication entity uses the certificate of the peer communication entity to encrypt the SMS with RSA public key, and encrypt the encrypted SMS It is transmitted to the communication entity through the classic channel; after the peer-to-peer communication entity receives the information, it enters the RSA private key protection password to restore the plaintext sent by the sender.

Description

一种基于RSA公钥的短信加密方法A Short Message Encryption Method Based on RSA Public Key

技术领域technical field

本发明属于网络空间安全技术领域,尤其涉及一种基于RSA公钥的短信加密方法。The invention belongs to the technical field of network space security, in particular to a short message encryption method based on an RSA public key.

背景技术Background technique

由于网络的迅速普及,数字化技术的快速发展,网络空间安全问题,逐渐走入人们的视野,为人们所重视。面临复杂多变的网络环境、潜在的网络威胁与攻击,计算机数据安全与加密,越来越受到人们的密切关注。如何保证数据在传输过程中的安全性,使得信息不被非法第三方窃取,显得尤为重要;数据加密作为网络中最基础的安全技术,以其代价小,防御主动有效而备受人们的青睐。RSA算法是目前最有影响力的公钥加密算法,是当前最著名、应用最广泛的公钥系统。早在1978年,就被由美国麻省理工学院(MIT)的Rivest、Shamir和Adleman在题为《获得数字签名和公开钥密码系统的方法》论文中提出,是一个基于数论的非对称(公开钥)密码体制,是一种分组密码体制;其名称来自于三个发明者的姓名首字母;已被ISO推荐为公钥加密标准;只要其钥匙的长度足够长,用RSA加密的信息实际上是不能被解破的;目前,RSA可根据密钥长度分为1024比特与2048比特两种。RSA算法基于大数分解:将两个大素数相乘十分容易,但是想要对其乘积进行因式分解却极其困难,因此可以将乘积公开作为加密密钥;RSA算法的优点有:1.能同时用于加密和数字签名的算法;2.易于理解和操作;3.该算法的加密密钥和加密算法分开,使得密钥分配更为方便;4.特别适用于网络环境,对于网络上的大量用户,可以将加密密钥以公钥目录的方式给出。近些年,智能移动端接管了人们生活的方方面面,人们利用手机、平板电脑等设备娱乐,社交,购物等等活动。作为基础功能之一的短信发送更是成为日常生活的重要组成部分。据统计,仅2013年全球短信发送就达到了10.3万亿条。虽然近些年,一些即时通讯软件占据了手机市场的半壁江山,但是不可否认,即时通讯软件仍然有很多弊端:1.过度依赖于网络,如果离开了数据网络,即时通讯软件便不能使用;2.即时通讯软件需要预装客户端,如果通信双方中有一方没有安装客户端,那么通信就无法继续进行;3.即时通讯软件现阶段还是给人一种非官方,不严谨的感觉;人们通知重要的事情,往往还是倾向于利用短信、电话等通信手段。Due to the rapid popularization of the Internet and the rapid development of digital technology, the issue of cyberspace security has gradually entered people's field of vision and attracted people's attention. Facing the complex and changeable network environment, potential network threats and attacks, computer data security and encryption are getting more and more people's close attention. How to ensure the security of data during transmission, so that information is not stolen by illegal third parties, is particularly important; data encryption, as the most basic security technology in the network, is favored by people for its low cost and active and effective defense. The RSA algorithm is currently the most influential public key encryption algorithm and the most famous and widely used public key system. As early as 1978, it was proposed by Rivest, Shamir and Adleman of the Massachusetts Institute of Technology (MIT) in a paper entitled "Methods for Obtaining Digital Signatures and Public Key Cryptosystems". It is an asymmetric (public) algorithm based on number theory. key) cryptographic system, which is a block cipher system; its name comes from the initials of the three inventors; it has been recommended by ISO as a public key encryption standard; as long as the length of the key is long enough, the information encrypted with RSA is actually It cannot be cracked; at present, RSA can be divided into two types according to the key length: 1024 bits and 2048 bits. The RSA algorithm is based on the decomposition of large numbers: it is very easy to multiply two large prime numbers, but it is extremely difficult to factorize the product, so the product can be made public as an encryption key; the advantages of the RSA algorithm are: 1. An algorithm used for encryption and digital signature at the same time; 2. Easy to understand and operate; 3. The encryption key of the algorithm is separated from the encryption algorithm, which makes key distribution more convenient; 4. It is especially suitable for network environments. For a large number of users, the encryption key can be given in the form of a public key directory. In recent years, smart mobile terminals have taken over all aspects of people's lives. People use mobile phones, tablet computers and other devices for entertainment, socializing, shopping and other activities. Sending short messages as one of the basic functions has become an important part of daily life. According to statistics, in 2013 alone, 10.3 trillion text messages were sent worldwide. Although some instant messaging software has occupied half of the mobile phone market in recent years, it is undeniable that instant messaging software still has many disadvantages: 1. Excessive dependence on the network. If you leave the data network, instant messaging software cannot be used; 2. Instant messaging software needs to pre-install the client. If one of the communication parties does not install the client, then the communication cannot continue; For things, they tend to use text messages, phone calls and other means of communication.

然而,人们日常使用的短信,却面临着来自恶意软件等方面的威胁,世界著名安全厂商赛门铁克发表了一份报告,称在所有安卓应用中,有百分之17都是恶意应用,每不到6个安卓App中就存在一个恶意软件,其泛滥程度可见一斑。统计还称,在2013年一年中,安卓平台上约有70万个恶意App;而到了2014年,安卓恶意App数量已经增长到了100万个。这些恶意软件会盗取用户隐私信息,诱使用户开通付费服务等等。恶意软件的其中一个重要的目标就是——盗取用户的短信内容。However, the text messages that people use every day are facing threats from malware and other aspects. Symantec, a world-renowned security company, published a report stating that 17% of all Android applications are malicious applications. There is one malware in less than six Android apps, which shows the extent of its prevalence. Statistics also show that in 2013, there were about 700,000 malicious apps on the Android platform; by 2014, the number of malicious apps on Android had grown to 1 million. These malicious software will steal user privacy information, induce users to subscribe to paid services, and so on. One of the important goals of malware is to steal the content of users' text messages.

发明内容Contents of the invention

本发明的目的在于提供一种基于RSA公钥的短信加密方法,旨在解决目前日常使用的短信存在恶意软件会盗取用户隐私信息,用户隐私遭到泄漏的问题。The purpose of the present invention is to provide a short message encryption method based on an RSA public key, aiming at solving the problem that the current daily short message has malicious software that will steal user privacy information and user privacy is leaked.

本发明是这样实现的,一种基于RSA公钥的短信加密方法,所述基于RSA公钥的短信加密方法包括以下步骤:The present invention is achieved in that a kind of short message encryption method based on RSA public key, described short message encryption method based on RSA public key comprises the following steps:

步骤一,通信实体提交个人身份信息申请文件给注册机构审核,注册机构审核通过之后,将申请文件提交给CA中心,CA中心根据此申请文件签发个人数字证书和对应私钥。CA中心通过U盘等存储设备将生成的个人数字证书和对应私钥交给通信实体。利用权威机构颁发的个人数字证书,通信实体可以有效证明自身身份,从而实现自身隐私数据的加密保护。Step 1: The communication entity submits the personal identity information application documents to the registration authority for review. After the registration agency passes the review, it submits the application documents to the CA center, and the CA center issues a personal digital certificate and corresponding private key based on the application documents. The CA center delivers the generated personal digital certificate and the corresponding private key to the communication entity through a storage device such as a USB flash drive. Using the personal digital certificate issued by the authoritative organization, the communication entity can effectively prove its identity, so as to realize the encryption protection of its own private data.

步骤二,通信实体对自己的身份与公钥证书和私钥进行绑定操作,指定证书的信任根;Step 2: The communication entity binds its own identity with the public key certificate and private key, and specifies the trust root of the certificate;

步骤三,通信实体与对等通信实体进行沟通,指定对等通信实体的公钥证书,对对等通信实体的公钥信息与身份信息进行一一对应,对等通信实体会向原通信实体返回公钥证书信息,拿到该证书后,将对等通信实体信息与证书作一一映射;Step 3: The communication entity communicates with the peer communication entity, specifies the public key certificate of the peer communication entity, and performs a one-to-one correspondence between the public key information and the identity information of the peer communication entity, and the peer communication entity returns the public key certificate to the original communication entity. Key certificate information, after obtaining the certificate, map the peer-to-peer communication entity information and the certificate one by one;

步骤四,通信实体用对等通信实体的证书对短信进行RSA公钥加密,将加密后的短信通过经典信道传送至通信实体;Step 4, the communication entity uses the certificate of the peer communication entity to perform RSA public key encryption on the short message, and transmits the encrypted short message to the communication entity through the classic channel;

步骤五,对等通信实体接收到信息之后,输入RSA私钥保护口令,将发送方发送的明文进行恢复。Step 5: After receiving the information, the peer-to-peer communication entity inputs the RSA private key protection password to restore the plaintext sent by the sender.

进一步,所述绑定的内容包括:个人身份信息与证书、私钥一一对应;个人身份信息包括电话号码、单位和姓名。Further, the bound content includes: the personal identity information corresponds to the certificate and the private key one by one; the personal identity information includes the phone number, unit and name.

进一步,所述指定证书的信任根,对与后缀名为cer的公钥证书文件,与后缀名为pfx的私钥文件进行浏览与指定。Further, the trust root of the specified certificate browses and specifies the public key certificate file with the suffix cer and the private key file with the suffix pfx.

进一步,在映射的过程中,调用Android原生系统提供的API函数,获取通信录姓名及对应电话,同时利用Shareparefence对各个属性字段进行键值对关联操作。Further, in the process of mapping, call the API function provided by the Android native system to obtain the address book name and corresponding phone number, and use Shareparfence to perform key-value pair association operations on each attribute field.

进一步,对短信进行RSA公钥加密,加密函数会从证书文件中读取公钥,将明文消息用Base64进行编码操作,再用公钥对明文编码后的明文消息进行加密处理,将加密后的编码过短信通过Android提供的原生态接口回调给发送短信的交互界面。Further, perform RSA public key encryption on the SMS, the encryption function will read the public key from the certificate file, encode the plaintext message with Base64, and then use the public key to encrypt the plaintext encoded plaintext message, and encrypt the encrypted plaintext message The encoded SMS is called back to the interactive interface for sending SMS through the original ecological interface provided by Android.

本发明的另一目的在于提供一种所述基于RSA公钥的短信加密方法的短信加密系统,所述短信加密系统包括:Another object of the present invention is to provide a short message encryption system based on the RSA public key short message encryption method, and the short message encryption system includes:

签发个人数字证书CA中心,用于根据用户提交的个人数字申请文件为新用户签发这人数字证书和相应的私钥文件;Issuing personal digital certificate CA center, which is used to issue personal digital certificates and corresponding private key files for new users according to the personal digital application files submitted by users;

证书私钥绑定模块,用于指定个人数字证书和私钥文件路径与使用用户的手机号绑定,生成身份属性文件;The certificate private key binding module is used to specify the personal digital certificate and private key file path to bind with the user's mobile phone number to generate an identity attribute file;

解密短信模块,用于接收短信,根据身份属性文件,获得私钥文件路径,并根据输入的解密口令获得私钥,从而解密短信;The decryption message module is used to receive the message, obtain the private key file path according to the identity attribute file, and obtain the private key according to the input decryption password, thereby decrypting the message;

阅读短信模块,用于调用系统短信数据库,将短信信息呈现给用户;The SMS reading module is used to call the system SMS database and present the SMS information to the user;

加密短信模块,用于发送短信,根据接收方的个人数字证书,加密短信;The encrypted message module is used to send the message, and encrypts the message according to the personal digital certificate of the receiver;

发送短信模块,用于调用系统短信发送模块发送短信;Sending a short message module, used to call the system short message sending module to send a short message;

签名短信模块,用于调用绑定的身份属性文件,获得私钥文件,为发送的短信签名,用于接收方验证短信的完整性。The signature message module is used to call the bound identity attribute file, obtain the private key file, and sign the message sent for the receiver to verify the integrity of the message.

本发明的另一目的在于提供一种应用所述基于RSA公钥的短信加密方法的Android移动平台。Another object of the present invention is to provide an Android mobile platform applying the method for encrypting short messages based on the RSA public key.

本发明的另一目的在于提供一种应用所述基于RSA公钥的短信加密方法的密钥共享方法。Another object of the present invention is to provide a key sharing method applying the RSA public key-based short message encryption method.

本发明的另一目的在于提供一种应用所述基于RSA公钥的短信加密方法的数字签名方法。Another object of the present invention is to provide a digital signature method applying the short message encryption method based on the RSA public key.

本发明的另一目的在于提供一种应用所述基于RSA公钥的短信加密方法的电子邮件加密方法。Another object of the present invention is to provide an email encryption method applying the RSA public key-based short message encryption method.

本发明提供的基于RSA公钥的短信加密方法,与现有技术相比,具有如下有益效果:Compared with the prior art, the short message encryption method based on the RSA public key provided by the present invention has the following beneficial effects:

(1)本发明没有借助任何外界的辅助硬件即可实现保密通信,实用性强,开发成本低、能耗少:具体来说,开发成本低表现在Android应用采用了SUN公司开发的Java语言,Java语言是一门高级语言,由于没有指针、不必刻意去管理内存,所以入门非常快。其二,Android本身拥有丰富的API调用接口,满足了大部分的开发需求,此外,在互联网上还有数量庞大的功能性开源库。:而能耗少表现在生成的APK文件是独立运行在Android系统上,只需要借助Android原生态的虚拟机,并没有任何辅助设备就可以实现加密解密,没有对系统本身造成任何源代码上的变更,没有对发短信的功能进行任何源代码上的修改,实现简单,并且不需要ROOT权限。(1) The present invention can realize confidential communication without any external auxiliary hardware, has strong practicability, low development cost, and less energy consumption: specifically, the low development cost shows that the Android application adopts the Java language developed by SUN Company, The Java language is a high-level language. Since there are no pointers and no need to deliberately manage memory, it is very fast to get started. Second, Android itself has a rich API calling interface, which meets most of the development needs. In addition, there are a large number of functional open source libraries on the Internet. : The low energy consumption shows that the generated APK file runs independently on the Android system. It only needs to rely on the original virtual machine of Android, and can realize encryption and decryption without any auxiliary equipment, without causing any source code damage to the system itself. Change, without any modification of the source code for the function of sending text messages, the implementation is simple, and does not require ROOT authority.

(2)本发明在使用的过程中,投递信息借助的信道是经典信道,不过分依赖网络。(2) During the use of the present invention, the channel used to deliver information is a classic channel and does not rely too much on the network.

(3)本发明采用了RSA加密算法,算法的安全性高,效率相对较高。例如,1999年,一台Cray超级电脑用了5个月时间分解了512位长的密钥,而分解一个768位RSA密钥所需时间是512位的数千倍,而1024位所需时间则是768位的一千多倍,因此现在普遍采用的1024位相对比较安全,而采用2048位是绝对安全的;适用于现实环境中,一对多,多对一的通信录式通信环境:具体来说,通过公钥加密体制的特性,用户可以将多个公钥对应于多个用户,然后根据公钥对每个通信的实体进行加密,同时也可选择将同一个公钥对应于一个通信组,满足于多人通信中对于组间用户的内容上的访问控制。(3) The present invention adopts the RSA encryption algorithm, which has high security and relatively high efficiency. For example, in 1999, a Cray supercomputer took 5 months to decompose a 512-bit long key, and the time required to decompose a 768-bit RSA key is thousands of times that of 512 bits, and the time required for 1024-bit It is more than a thousand times that of 768 bits, so the 1024 bits commonly used now are relatively safe, and the use of 2048 bits is absolutely safe; it is suitable for real-world environments, one-to-many, many-to-one address book communication environments: Specifically, through the characteristics of the public key encryption system, users can associate multiple public keys with multiple users, and then encrypt each communicating entity according to the public key, and can also choose to associate the same public key with a The communication group satisfies the access control on the content of users between groups in multi-person communication.

(4)本发明有效地解决了双卡双待中密钥的分发问题,在双卡环境中,用户既可以将两个卡对应的号码捆绑至一对公私钥上,又可以将两个卡对应的号码捆绑于两对公私上。完全取决于用户对于安全性的需求;用户不需要过硬的密码学背景便可对软件熟练使用,用户体验相对好。(4) The present invention effectively solves the problem of key distribution in dual-card dual-standby. The corresponding numbers are tied to two pairs of public and private. It all depends on the user's needs for security; users do not need a strong cryptography background to use the software proficiently, and the user experience is relatively good.

(5)本发明从技术上真正实现了对应和绑定操作,大部分界面与功能都是Android系统原生态的功能,如短信发送,通信录等,因而体积小巧,安装包不到2M;RSA是一种目前最有影响力的公钥加密算法,被ISO推荐为公钥数据加密标准。RSA除了用于加密,还可用于密钥共享,数字签名等密码学领域。基于RSA公钥加密技术则可以应用于电子邮件加密系统、企业内部隐私文件保护等领域。(5) The present invention has really realized the correspondence and binding operation technically, and most of the interfaces and functions are the original ecological functions of the Android system, such as sending short messages, address books, etc., so the volume is small and exquisite, and the installation package is less than 2M; RSA It is currently the most influential public key encryption algorithm and is recommended by ISO as a public key data encryption standard. In addition to being used for encryption, RSA can also be used in the field of cryptography such as key sharing and digital signature. RSA-based public key encryption technology can be applied to email encryption systems, enterprise internal privacy file protection and other fields.

附图说明Description of drawings

图1是本发明实现所提供的基于RSA公钥的短信加密方法流程图。Fig. 1 is the flow chart of the short message encryption method based on the RSA public key provided by the present invention.

图2是本发明实现所提供的基于RSA公钥的短信加密系统结构示意图。FIG. 2 is a schematic structural diagram of the RSA public key-based short message encryption system provided by the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention more clear, the present invention will be further described in detail below in conjunction with the examples. It should be understood that the specific implementations described here are only used to explain the present invention, not to limit the present invention.

本发明借助第三方可信机构CA颁发的证书,可以保证通信实体A与通信实体B之间的安全通信。通信实体A向B发送的信息,只有通信实体B可以解密,任何中间人为的窃听,恶意软件的盗取,都不能窥探短信息本身的内容。The present invention can guarantee the safe communication between the communication entity A and the communication entity B by means of the certificate issued by the third-party trusted organization CA. The information sent by communication entity A to B can only be decrypted by communication entity B, and any man-made eavesdropping or malicious software theft cannot spy on the content of the short message itself.

下面结合附图对本发明的应用原理作详细的描述。The application principle of the present invention will be described in detail below in conjunction with the accompanying drawings.

如图1所示,本发明实现所提供的基于RSA公钥的短信加密方法包括以下步骤:As shown in Figure 1, the short message encryption method based on the RSA public key that the present invention realizes provided comprises the following steps:

S101:通信实体,通过第三方CA获得个人的数字证书和对应的私钥;S101: The communication entity obtains a personal digital certificate and a corresponding private key through a third-party CA;

S102:通信实体(发送方)对自己的身份与公钥证书和私钥进行绑定操作;绑定的内容包括:个人身份信息(包括电话号码,单位,姓名)与证书、私钥一一对应,如A绑定A的证书,私钥;同时,指定证书的信任根;S102: The communication entity (sender) binds its own identity with the public key certificate and private key; the binding content includes: personal identity information (including phone number, unit, name) corresponds to the certificate and private key one by one , such as A binds A's certificate and private key; at the same time, specify the trust root of the certificate;

S103:通信实体(发送方)与对等通信实体(接收方)进行沟通,指定对等通信实体的公钥证书,对对等通信实体的公钥信息与身份信息进行一一对应,对等通信实体(接收方)会向原通信实体(发送方)返回一个公钥证书信息,发送方拿到该证书后,将接收方信息(电话号码,姓名,单位)与证书作一一映射;S103: The communication entity (sender) communicates with the peer communication entity (receiver), specifies the public key certificate of the peer communication entity, and performs one-to-one correspondence between the public key information and identity information of the peer communication entity, and peer-to-peer communication The entity (receiver) will return a public key certificate information to the original communication entity (sender), and the sender will map the receiver information (phone number, name, unit) with the certificate after obtaining the certificate;

S104:发送方用接收方的证书对短信进行RSA公钥加密,将加密后的短信通过经典信道传送至接收方;S104: The sender uses the receiver's certificate to encrypt the short message with the RSA public key, and transmits the encrypted short message to the receiver through the classic channel;

S105:接收方接收到信息之后,输入RSA私钥保护口令,将发送方发送的明文进行恢复。S105: After receiving the information, the receiver inputs the RSA private key protection password to restore the plaintext sent by the sender.

如图2所示,本发明实现所提供的基于RSA公钥的短信加密系统包括:As shown in Figure 2, the short message encryption system based on the RSA public key that the present invention realizes to provide includes:

签发个人数字证书CA中心:该CA中心是根据X509标准设计实现的个人数字证书签发系统。CA中心根据用户提交的个人数字申请文件为新用户签发这人数字证书和相应的私钥文件。Issuing personal digital certificate CA center: The CA center is a personal digital certificate issuing system designed and implemented according to the X509 standard. The CA center issues the digital certificate and corresponding private key file for the new user according to the personal digital application file submitted by the user.

证书私钥绑定模块:指定个人数字证书和私钥文件路径与使用用户的手机号绑定,生成身份属性文件。Certificate private key binding module: Specify the personal digital certificate and private key file path to bind with the user's mobile phone number to generate an identity attribute file.

解密短信模块:用于接收短信,根据身份属性文件,获得私钥文件路径,并根据输入的解密口令获得私钥,从而解密短信。Decryption SMS module: used to receive SMS, obtain the private key file path according to the identity attribute file, and obtain the private key according to the input decryption password, thereby decrypting the SMS.

阅读短信模块:调用系统短信数据库,将短信信息呈现给用户。Read short message module: call the system short message database, and present the short message information to the user.

加密短信模块:用于发送短信,根据接收方的个人数字证书,加密短信。Encrypted SMS module: used to send SMS, according to the receiver's personal digital certificate, encrypted SMS.

发送短信模块:调用系统短信发送模块发送短信。Send SMS module: call the system SMS sending module to send SMS.

签名短信模块:调用绑定的身份属性文件,获得私钥文件,为发送的短信签名,用于接收方验证短信的完整性。下面结合具体实施例对本发明的应用原理作进一步的描述。Signature SMS module: call the bound identity attribute file, obtain the private key file, and sign the sent SMS for the recipient to verify the integrity of the SMS. The application principle of the present invention will be further described below in combination with specific embodiments.

本发明实现所提供的基于RSA公钥的短信加密方法包括以下步骤:The present invention realizes that the short message encryption method based on the RSA public key provided comprises the following steps:

步骤一,通信实体A与B,通过第三方CA获得个人的数字证书和对应的私钥,具体获得过程是通过提交个人身份信息申请文件给注册机构审核,注册机构审核通过之后,将申请文件提交给CA中心,CA中心根据此申请文件签发个人数字证书和对应私钥。CA中心通过U盘等存储设备将生成的个人数字证书和对应私钥交给用户,进而用户获得个人的数字证书和对应的私钥。Step 1. Communication entities A and B obtain personal digital certificates and corresponding private keys through a third-party CA. The specific acquisition process is to submit personal identity information application documents to the registration agency for review. After the registration agency passes the review, submit the application documents To the CA center, the CA center issues a personal digital certificate and corresponding private key based on this application file. The CA center delivers the generated personal digital certificate and corresponding private key to the user through a storage device such as a U disk, and then the user obtains the personal digital certificate and corresponding private key.

步骤二,通信实体A对自己的身份与公钥证书和私钥进行绑定操作;绑定的内容包括:个人身份信息(包括电话号码、单位和姓名)与证书、私钥一一对应。如A绑定A的证书,私钥;同时,指定证书的信任根,在指定的过程中,软件内置文件浏览功能,可对与后缀名为cer的公钥证书文件,与后缀名为pfx的私钥文件进行浏览与指定;其余文件本软件会对其进行忽略处理;绑定过程中我们利用Android原生系统为开发者提供的Shareparefence对各个属性字段进行键值对关联操作;利用代码同步以及内部类构造器等技术保证关联操作的线程安全性。Step 2, the communication entity A binds its own identity with the public key certificate and private key; the bound content includes: personal identity information (including phone number, unit and name) corresponds to the certificate and private key one by one. For example, A binds the certificate and private key of A; at the same time, specify the trust root of the certificate. In the process of specifying, the software has a built-in file browsing function, which can compare the public key certificate file with the suffix cer and the public key certificate file with the suffix pfx Browse and specify the private key file; other files will be ignored by the software; during the binding process, we use the Shareparfence provided by the Android native system for developers to perform key-value pair association operations on each attribute field; use code synchronization and internal Techniques such as class constructors ensure the thread safety of associated operations.

步骤三,通信实体(发送方A)与对等通信实体(接收方B)进行沟通,发送方A指定接收方B的公钥证书,对对等通信实体的公钥信息与身份信息进行一一对应;具体来说,对等通信实体(接收方)会向原通信实体(发送方)返回一个公钥证书信息,发送方拿到该证书后,将接收方信息(电话号码,姓名,单位)与证书作一一映射;在映射的过程中,调用Android原生系统提供的API函数,获取通信录姓名及对应电话,同时利用Android原生系统为开发者提供的Shareparefence对各个属性字段进行键值对关联操作;利用代码同步以及内部类构造器等技术保证关联操作的线程安全性。Step 3: The communication entity (sender A) communicates with the peer-to-peer communication entity (receiver B), and the sender A specifies the public key certificate of the receiver B, and checks the public key information and identity information of the peer-to-peer communication entity Correspondence; Specifically, the peer-to-peer communication entity (receiver) will return a public key certificate information to the original communication entity (sender). One-to-one mapping of certificates; in the process of mapping, call the API function provided by the Android native system to obtain the address book name and corresponding phone number, and use the Shareparfence provided by the Android native system for developers to perform key-value pair association operations on each attribute field ; Make use of technologies such as code synchronization and internal class constructors to ensure the thread safety of associated operations.

步骤四,发送方用接收方的证书对短信进行RSA公钥加密,加密函数会从证书文件中读取公钥,同时将明文消息用Base64进行编码操作,再用公钥对明文编码后的明文消息进行加密处理,将加密后的编码过短信通过Android提供的原生态接口回调给发送短信的交互界面,再由经典信道传送至接收方;选择使用交互界面而非直接后台发送的原因是由于很多Android系统对原生系统的改动较大,加上了API钩子等约束应用直接发送短信的接口,直接发送有可能导致软件在发送过程中调用失败。Step 4: The sender uses the receiver's certificate to encrypt the SMS with the RSA public key. The encryption function will read the public key from the certificate file, and at the same time encode the plaintext message with Base64, and then use the public key to encode the plaintext encoded plaintext The message is encrypted, and the encrypted encoded text message is called back to the interactive interface for sending text messages through the original ecological interface provided by Android, and then transmitted to the receiver through the classic channel; the reason for choosing to use the interactive interface instead of directly background sending is due to many The Android system has made a lot of changes to the original system, and has added API hooks and other interfaces that constrain the application to send SMS directly. Direct sending may cause the software to fail to call during the sending process.

步骤五,接收方接收到信息之后,输入RSA私钥保护口令,将发送方发送的明文进行恢复。回复后,再用Base64进行编码,最终恢复出明文信息。Step 5: After receiving the information, the receiver enters the RSA private key protection password to recover the plaintext sent by the sender. After the reply, encode it with Base64, and finally recover the plaintext information.

以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention should be included in the protection of the present invention. within range.

Claims (10)

1.一种基于RSA公钥的短信加密方法,其特征在于,所述基于RSA公钥的短信加密方法包括以下步骤:1. a kind of note encryption method based on RSA public key, it is characterized in that, described note encryption method based on RSA public key comprises the following steps: 步骤一,通信实体通过第三方CA获得个人的数字证书和对应的私钥;Step 1, the communication entity obtains the personal digital certificate and the corresponding private key through the third-party CA; 步骤二,通信实体对自己的身份与公钥证书和私钥进行绑定操作,指定证书的信任根;Step 2: The communication entity binds its own identity with the public key certificate and private key, and specifies the trust root of the certificate; 步骤三,通信实体与对等通信实体进行沟通,指定对等通信实体的公钥证书,对对等通信实体的公钥信息与身份信息进行一一对应,对等通信实体会向原通信实体返回公钥证书信息,拿到该证书后,将对等通信实体信息与证书作一一映射;Step 3: The communication entity communicates with the peer communication entity, specifies the public key certificate of the peer communication entity, and performs a one-to-one correspondence between the public key information and the identity information of the peer communication entity, and the peer communication entity returns the public key certificate to the original communication entity. Key certificate information, after obtaining the certificate, map the peer-to-peer communication entity information and the certificate one by one; 步骤四,通信实体用对等通信实体的证书对短信进行RSA公钥加密,将加密后的短信通过经典信道传送至通信实体;Step 4, the communication entity uses the certificate of the peer communication entity to perform RSA public key encryption on the short message, and transmits the encrypted short message to the communication entity through the classic channel; 步骤五,对等通信实体接收到信息之后,输入RSA私钥保护口令,将发送方发送的明文进行恢复。Step 5: After receiving the information, the peer-to-peer communication entity inputs the RSA private key protection password to restore the plaintext sent by the sender. 2.如权利要求1所述的基于RSA公钥的短信加密方法,其特征在于,所述绑定的内容包括:个人身份信息与证书、私钥一一对应;个人身份信息包括电话号码,单位,姓名。2. the short message encryption method based on RSA public key as claimed in claim 1, is characterized in that, the content of described binding comprises: personal identity information and certificate, private key one-to-one correspondence; Personal identity information comprises telephone number, unit ,Name. 3.如权利要求1所述的基于RSA公钥的短信加密方法,其特征在于,所述指定证书的信任根,对与后缀名为cer的公钥证书文件,与后缀名为pfx的私钥文件进行浏览与指定。3. the short message encryption method based on RSA public key as claimed in claim 1, is characterized in that, the root of trust of the specified certificate, to the public key certificate file with suffix name cer, and the private key with suffix name pfx Files can be browsed and specified. 4.如权利要求1所述的基于RSA公钥的短信加密方法,其特征在于,在映射的过程中,调用Android原生系统提供的API函数,获取通信录姓名及对应电话,同时利用Shareparefence对各个属性字段进行键值对关联操作。4. the short message encryption method based on RSA public key as claimed in claim 1, it is characterized in that, in the process of mapping, call the API function that Android native system provides, obtain address book name and corresponding phone, utilize Shareparfence to each Attribute fields perform key-value pair association operations. 5.如权利要求1所述的基于RSA公钥的短信加密方法,其特征在于,对短信进行RSA公钥加密,加密函数会从证书文件中读取公钥,将明文消息用Base64进行编码操作,再用公钥对明文编码后的明文消息进行加密处理,将加密后的编码过短信通过Android提供的原生态接口回调给发送短信的交互界面。5. the short message encryption method based on RSA public key as claimed in claim 1, it is characterized in that, carry out RSA public key encryption to short message, encryption function can read public key from certificate file, and plaintext message is encoded with Base64 , and then use the public key to encrypt the encoded plaintext message, and call back the encrypted encoded text message to the interactive interface for sending text messages through the original ecological interface provided by Android. 6.一种如权利要求1所述基于RSA公钥的短信加密方法的短信加密系统,其特征在于,所述短信加密系统包括:6. a kind of short message encryption system based on the short message encryption method of RSA public key as claimed in claim 1, is characterized in that, described short message encryption system comprises: 数字证书CA中心,用于根据用户提交的个人数字申请文件为新用户签发个人数字证书和相应的私钥文件;The digital certificate CA center is used to issue personal digital certificates and corresponding private key files to new users according to the personal digital application files submitted by users; 证书私钥绑定模块,用于指定个人数字证书和私钥文件路径与使用用户的手机号绑定,生成身份属性文件;The certificate private key binding module is used to specify the personal digital certificate and private key file path to bind with the user's mobile phone number to generate an identity attribute file; 解密短信模块,用于接收短信,根据身份属性文件,获得私钥文件路径,并根据输入的解密口令获得私钥,从而解密短信;The decryption message module is used to receive the message, obtain the private key file path according to the identity attribute file, and obtain the private key according to the input decryption password, thereby decrypting the message; 阅读短信模块,用于调用系统短信数据库,将短信信息呈现给用户;The SMS reading module is used to call the system SMS database and present the SMS information to the user; 加密短信模块,用于发送短信,根据接收方的个人数字证书,加密短信;The encrypted message module is used to send the message, and encrypts the message according to the personal digital certificate of the recipient; 发送短信模块,用于调用系统短信发送模块发送短信;Sending a short message module, used to call the system short message sending module to send a short message; 签名短信模块,用于调用绑定的身份属性文件,获得私钥文件,为发送的短信签名,用于接收方验证短信的完整性。The signature message module is used to call the bound identity attribute file, obtain the private key file, and sign the message sent for the receiver to verify the integrity of the message. 7.一种应用权利要求1-5任意一项所述基于RSA公钥的短信加密方法的Android移动平台。7. an Android mobile platform using any one of claim 1-5 based on the short message encryption method based on the RSA public key. 8.一种应用权利要求1-5任意一项所述基于RSA公钥的短信加密方法的密钥共享方法。8. A key sharing method applying the short message encryption method based on the RSA public key according to any one of claims 1-5. 9.一种应用权利要求1-5任意一项所述基于RSA公钥的短信加密方法的数字签名方法。9. A digital signature method applying the RSA public key-based short message encryption method according to any one of claims 1-5. 10.一种应用权利要求1-5任意一项所述基于RSA公钥的短信加密方法的电子邮件加密方法。10. An email encryption method using any one of claims 1-5 based on the RSA public key encryption method for short messages.
CN201610550887.0A 2016-07-13 2016-07-13 A kind of message encryption method based on RSA PKI Pending CN106211108A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610550887.0A CN106211108A (en) 2016-07-13 2016-07-13 A kind of message encryption method based on RSA PKI

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610550887.0A CN106211108A (en) 2016-07-13 2016-07-13 A kind of message encryption method based on RSA PKI

Publications (1)

Publication Number Publication Date
CN106211108A true CN106211108A (en) 2016-12-07

Family

ID=57477911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610550887.0A Pending CN106211108A (en) 2016-07-13 2016-07-13 A kind of message encryption method based on RSA PKI

Country Status (1)

Country Link
CN (1) CN106211108A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110390207A (en) * 2019-06-26 2019-10-29 江苏大学 A method for protecting the privacy of personal information in online shopping and a delivery method
CN111787369A (en) * 2019-04-03 2020-10-16 深圳Tcl数字技术有限公司 Root authority control method and system for smart television and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040050742A (en) * 2002-12-09 2004-06-17 한국전자통신연구원 Apparatus for public key cryptography on the prime field
CN102104844A (en) * 2009-12-16 2011-06-22 北京邮电大学 Mobile phone encrypted short message structure and method for transmitting and receiving mobile phone encrypted short message by applying same

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20040050742A (en) * 2002-12-09 2004-06-17 한국전자통신연구원 Apparatus for public key cryptography on the prime field
CN102104844A (en) * 2009-12-16 2011-06-22 北京邮电大学 Mobile phone encrypted short message structure and method for transmitting and receiving mobile phone encrypted short message by applying same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王继林,苏万力: "密钥管理", 《信息安全导论》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111787369A (en) * 2019-04-03 2020-10-16 深圳Tcl数字技术有限公司 Root authority control method and system for smart television and storage medium
CN110390207A (en) * 2019-06-26 2019-10-29 江苏大学 A method for protecting the privacy of personal information in online shopping and a delivery method

Similar Documents

Publication Publication Date Title
CA2869404C (en) Public key encryption algorithms for hard lock file encryption
CN103795533B (en) Encryption based on identifier, the method and its performs device of decryption
US10938792B2 (en) Layered encryption for end to end communication
JP7420779B2 (en) Key protection processing method, device, equipment and storage medium
TW202113646A (en) Private key generation and use method, apparatus and device in asymmetric key
CN106254342A (en) The secure cloud storage method of file encryption is supported under Android platform
CN204360381U (en) mobile device
CN106897879A (en) Block chain encryption method based on the PKI CLC close algorithms of isomerization polymerization label
Beato et al. For some eyes only: protecting online information sharing
CN106302411A (en) The secure cloud storage method and system of support file encryption based on windows platform
CN111010266A (en) Message encryption and decryption, reading and writing method, device, computer equipment and storage medium
CN104660568B (en) A kind of guard method of address list information and device
Thilakanathan et al. Secure multiparty data sharing in the cloud using hardware-based TPM devices
Sivasakthi et al. Applying digital signature with encryption algorithm of user authentication for data security in cloud computing
CN118898081B (en) File encryption method and system based on CP-ABE and USBKEY
CN115022057A (en) Security authentication method, device and device, and storage medium
CN106211108A (en) A kind of message encryption method based on RSA PKI
Mateescu et al. A hybrid approach of system security for small and medium enterprises: Combining different cryptography techniques
CN105187379B (en) Password based on multi-party mutual mistrust splits management method
CN107689867B (en) A key protection method and system in an open environment
CN115208630B (en) Block chain-based data acquisition method and system and block chain system
CN116894268A (en) High-performance privacy exchange method, system and related equipment for mass data
Tsai et al. Secure data-sharing using distributed environmental matching keys
Dasari et al. An effective framework for ensuring data privacy in private cloud
Auwal et al. Cloud-based online social network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161207