Search Issue Tracker

Fixed in 5.0.1

Votes

4

Found in

5.0.0f4

Issue ID

677985

Regression

Yes

IL2CPP: RSACryptoServiceProvider doesn't work

Scripting

-

-e: The RSACryptoServiceProvider class seems broken on the IL2CPP backend.

-repro:
--open attached project
--build&run TestScene for iOS with IL2CPP
--NOTICE exceptions being loggedin xcode (see below) and test not working
--work fine with Mono

-test:

public static void SimpleTest()
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024);
RSAParameters publicKey = rsa.ExportParameters(false);

string name = "SimpleTest";
byte[] unencrypted = Encoding.UTF8.GetBytes(name);
RSACryptoServiceProvider remoteRSA = new RSACryptoServiceProvider();
remoteRSA.ImportParameters(publicKey);
byte[] encrypted = remoteRSA.Encrypt(unencrypted, false);

byte[] decryptedPacket = rsa.Decrypt(encrypted, false);
name = Encoding.UTF8.GetString(decryptedPacket);
Debug.Log("Decrypted message = " + name);
}

-errors:

2015-03-06 12:24:05.470 dark[2126:1187099] -> registered mono modules 0x100f32d60
-> applicationDidFinishLaunching()
-> applicationDidBecomeActive()
Requesting Resolution: 2048x1536
Init: screen size 2048x1536
Initializing Metal device caps
Initialize engine version: 5.0.0f4 (5b98b70ebeb9)
CryptographicException: PKCS1 decoding error.
at System.Security.Cryptography.HashAlgorithm.ComputeHash (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter.SetKey (System.Security.Cryptography.AsymmetricAlgorithm key) [0x00000] in <filename unknown>:0
at System.Globalization.GregorianCalendar.GetYear (DateTime time) [0x00000] in <filename unknown>:0
at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt (System.Byte[] rgb, Boolean fOAEP) [0x00000] in <filename unknown>:0
at RSATest.SimplerTest () [0x00000] in <filename unknown>:0
at RSATest.Start () [0x00000] in <filename unknown>:0
at Replacements.MSCompatUnicodeTable.get_IsReady () [0x00000] in <filename unknown>:0
Replacements.MSCompatUnicodeTable:get_IsReady()

(Filename: currently not available on il2cpp Line: -1)

Comments (3)

  1. ThomasMore1

    Jul 15, 2020 13:20

    As a beginning stage, you should consider some significant encounters throughout your life that have truly affected you, either decidedly, contrarily or both. Some average reflection article subjects include a genuine encounter, an envisioned encounter, an extraordinary item or spot, an individual who had an effect on you, or something you have watched or perused. In the event that you are composing an intelligent paper as a feature of a scholarly exercise, odds are your mentor will request that you center around a specific scene –, for example when you needed to settle on a significant choice – and think about what the results were. Note additionally, that the result of the experience is particularly significant in an intelligent exposition; miss this out and you will essentially be narrating.
    By: https://www.domyessays.co.uk/

  2. ThomasMore1

    Apr 24, 2020 13:07

    Your paper will meddle with whatever else you have going on – a public activity, brandishing duties, social orders, other exposition requests. Try not to try and attempt and surrender rolls for Lent, they'll essentially turn into their own nutrition type when you're too occupied to even think about writing and edgy for sugar.
    By: https://www.writemyessays.org.uk/

  3. inbeatable0101

    Jul 26, 2019 06:47

    Microsoft Windows having lots of ultimate application for using by the Windows Users so you also http://internetexplorerwindows10.com want to be participation of that application within operated by windows operating system.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.