Rate This Document
Findability
Accuracy
Completeness
Readability

Introduction

This document describes how to develop the Rivest-Shamir-Adleman (RSA) demo code in the TrustZone environment of Kunpeng servers.

RSA Encryption Algorithm

RSA is a public-key cryptography (also called asymmetric encryption) algorithm proposed in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman at the Massachusetts Institute of Technology (MIT). It is the most widely used and accepted public key algorithm, which is rock-solid, a longer key posing a higher difficulty in cracking. According to disclosed documents, the longest RSA key that was cracked had 768 bits, and no keys longer than 768 bits have ever been cracked. That means a 1024-bit RSA key is secure enough, and a 2048-bit RSA key is extremely secure.

RSA Digital Signatures

The RSA digital signature system works based on the RSA public key cryptographic algorithm. The RSA algorithm has been verified to be secure in practice (so far), and the RSA digital signature system has been widely used in many security standards.

The RSA digital signature system consists of the signature algorithm and verification algorithm. It encrypts the message digest generated by a hash function (SHA256) rather than directly encrypting the original text. If the original text changes, the message digest also changes, and the value of the digital signature changes accordingly. That is, different messages receive different digital signatures. A valid digital signature enables the receiver to verify that the message is from the real sender. This is because the private key of the signature is available only to the sender and no any other can perform the same digital signature. If a third party impersonates the real sender to send a message, the receiver uses the public key of the sender to verify the digital signature. If the third party does not know the private key of the real sender, the digital signature generated after encryption is different from the recalculated digital signature. In this way, the authenticity of the digital signature is guaranteed.