The AES-RSA Hybrid Encryption: A Balanced Approach to Secure Communication

Boren Song
3 min readNov 24, 2023

--

Today, transmission of data has become paramount due to innovation technology. In order to protect the personal data. People invented many encryption standards. We are going to introduce two encryption systems, AES and RSA. Both encryption standards are commonly used, especially AES. However, when applying one of them solely, it will cause security problem. Hence, this is where the AES-RSA hybrid encryption system comes into play, it helps to leverage the strengths of both to provide a better solution for securing message.

Understanding AES and Its Foundations in Galois Field

AES is a symmetric encryption system that use the same key for encryption and decryption. The mathematical insight behind AES is the Galois Field which is a very pure mathematical concept. The concept of field is proposed by famous French mathematician Galois.

The definition of Field is a set which combine with addition and multiplication, and every element in the set has their additive and multiplicative inverse. But why this particular field? The choice of GF (2⁸) is grounded in a balance of computational efficiency and security. We want the encryption process is secure and also don’t take huge amount of time. Also, the operations within this field, including addition and multiplication, are computationally manageable while providing a sufficient level of complexity to thwart most cryptographic attacks. The structure of GF (2⁸) allows for a diverse set of operations, making the AES algorithm both versatile and secure.

The Symmetric Dilemma: Sharing the AES Key

Despite its strengths, AES has a notable drawback: the necessity of sharing the encryption key. In scenarios where secure key distribution is challenging, this becomes a significant security risk. If an attacker intercepts the key during transmission, the entirety of the encrypted data is compromised.

RSA: Asymmetric Encryption to the Rescue

Enter RSA, an asymmetric encryption system that uses a pair of keys — a public key for encryption and a private key for decryption. This resolves the key distribution problem inherent in symmetric systems like AES. However, RSA also has deficiency. The algorithm struggles with encrypting large amounts of data due to its computational intensity. Moreover, RSA requires large prime numbers to generate keys, and sourcing reliable, large prime numbers can be a resource-intensive task.

Hybrid Encryption: Best of Both Worlds

The AES-RSA hybrid system ingeniously combines these two encryption methods to mitigate their individual shortcomings. In this system, RSA is used to encrypt the AES key, which is then transmitted securely. The actual data is encrypted using AES, combining the efficiency of symmetric encryption with the secure key distribution of asymmetric encryption.

Enhancing Security with Random Prime Number Generation

To further increase the security of the RSA component, our system incorporates a random prime number generator. Computing a large prime(over 250 digits) is usually time consuming, so we decide to create a new prime number each time when using the RSA, then prime number over 100 digits will be good to ensure the security. Combining this generator can significantly reduce the time complexity of the encryption process.

The Role of the Rabin-Miller Primality Test

To generate the prime number, we take advantage of Rabin-Miller test. There is a theorem states that x² = 1 mod p is only 1 and -1 if and only if p is prime, and we can construct a special sequence such that each following element is the square root of the previous one. Then we can claim that if p is prime, there are only two case. Either all elements are 1, or the first none 1 element is -1. This method significantly enhancing the efficiency of prime number generation for RSA key creation. This not only speeds up the key generation process but also adds to the overall security of the system.

Conclusion: A Balanced and Secure Encryption Strategy

We create this primary AES-RSA hybrid encryption system trying to utilize symmetrical and asymmetrical encryption process. But there are definitely more aspects need to be improved. In future relative research, I would like to simplified the AES encryption process, like fast implementation of substitution box. Also, I want to include elliptic curve key exchange which is a popular encryption standard used by finical systems in this hybrid system.

The code of research: https://colab.research.google.com/drive/1KMPGTb02FGlOMmP7OzDbekMdJWxqm169?usp=sharing

The presentation slide of research: https://docs.google.com/presentation/d/1koYDEiiuhnsSzaA226FkQL-hO4k_aeO88V1vNyNc4qY/edit?usp=sharing

--

--