RSA-OAEP-matlab

RSA-OAEP encryption-decryption using matlap

https://github.com/AhmedSalah339/RSA-OAEP-matlab

You are now following this Submission

About

RSA encryption using Optimal Asymmetric Encryption Padding with matlab which encrypts and dycrypts text in a query file.

Dependecies

you will need only the vpi package: https://www.mathworks.com/matlabcentral/fileexchange/22725-variable-precision-integer-arithmetic

Introduction

RSA is a famous encryption-decryption system which is oftenly used along with the OAEP to ensure the security of the data.

Using random n bits primes the rsa is encrypting a messege after the OAEP converts the charachters uint8 representation to random encoding using random-oracle hash functions like SHA-256 which is used here.

the RSA then uses the two random primes to generate the public and the private keys, encrypt the messege with the public key save it in a file and then decrypt it in another file using the private key to get the numbers generated by the OAEP earlier on the sender side.

The OAEp decrypts the messege and gets the original messege back and saves it in a folder.

Limitations

* The code is slow as the vpi package takes a big time in calculations.

You can try using one of the alternatives in this post to boost speed: https://www.mathworks.com/matlabcentral/answers/116949-big-integer-speed-vpi-and-symbolic

* The function isprime can be further improved to make the time costly check more fast or to use prior check different than fermat's little theorem that is more percise.

This link can be helpful: https://www.geeksforgeeks.org/prime-numbers/ (I suggest using Lucas test)

Cite As

Ahmed Salah (2026). RSA-OAEP-matlab (https://github.com/AhmedSalah339/RSA-OAEP-matlab/releases/tag/V1.1.0), GitHub. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0

See release notes for this release on GitHub: https://github.com/AhmedSalah339/RSA-OAEP-matlab/releases/tag/V1.1.0

1.0.0

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.