RSA encryption using public key - MATLAB Cody - MATLAB Central

Problem 44959. RSA encryption using public key

Difficulty:Rate

Encrypt the message text by converting to uint8 matrix using UTF-8 representation. Convert uint8 matrix to a large integer string. Use RSA encryption on the integer string given the public keys (n and e) and output the encrypted integer string. The public key (e) will always be fixed at 65537. No hashing or padding of the message is done.

For example:

message = 'I like to swim!';%given as input
integer_String = '379695297047669462525290688599911713';%calculated
n='418336393847020647250825879743341651032293545176800777981294580200903315345456262337972725306797613061';%given as input
e= 65537;%fixed
output_String = '158037161019988039882393476857386648994978438821991287680442802412825849535544067751541256843540494019';%output

See: https://simple.wikipedia.org/wiki/RSA_algorithm

Solution Stats

27.66% Correct | 72.34% Incorrect
Last Solution submitted on Mar 18, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers6

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!