Problem 44961. RSA decryption
Decrypt a large integer string using RSA decryption given the public key (n) and private key (d). Convert the large integer decryption into an output message string with UTF-8 representation.
Example:
encrypted_message = '158037161019988039882393476857386648994978438821991287680442802412825849535544067751541256843540494019';%input n='418336393847020647250825879743341651032293545176800777981294580200903315345456262337972725306797613061';%input d='8444986024072025211908427894173383040354675378319105204646840203847580180874615752845913488969020869';%input decrypted_message = 'I like to swim!';%output
Solution Stats
Problem Comments
-
3 Comments
William
on 8 Sep 2019
David -- Good problem. I got sidetracked by the fact that the arguments 'd' and 'n' in the solution template are reversed from the order that they are provided in the test problems.
David Hill
on 8 Sep 2019
Sorry, I did not mean to do that. Fixed.
Rafael S.T. Vieira
on 23 Oct 2020
Similar to the first https://www.mathworks.com/matlabcentral/cody/problems/44959-rsa-encryption-using-public-key It is necessary to convert the number obtained back from base 256 to base 10.
Solution Comments
Show commentsGroup

Advanced Cryptography Algorithms and Mathematics
- 21 Problems
- 0 Finishers
- Determine RSA keys (public and private) given two prime number character strings (p and q)
- Create State Array for initiating SHA-3-224 Hash
- RSA encryption using public key
- RSA decryption
- Mask Generation Function (MGF1) for PKCS #1 Standard utilizing Optimal Asymmetric Encryption Padding for RSA Cryptography
- Optimal Asymmetric Encryption Padding of message for RSA Cryptography
- Optimal Asymmetric Encryption Padding decoding of message for RSA Cryptography
- Find R*Rp-N*Np=1 given gcd(R,N)=1
- Montgomery Reduction Algorithm (REDC)
- Inverse Number Theoretic Transform (iNTT)
- Number Theoretic Transform (NTT)
- Montgomery Multiplication
- Output the Montgomery Form of the Input Matrix
- RIPEMD160 Hash
- SHA256 Hashing
- Binary Array to Hex Representation
- String to Binary Representation
- AES-256 KeyExpansion()
- AES SubBytes() Transformation
- Elliptic Curve Cryptography (ECC) Point Addition
- Obtain the Bitcoin address associated to a given private key
Problem Recent Solvers6
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!