Hi
After purchasing a certain amount of weapons
This error occurs.
"CryptographicException: The data to be encrypted exceeds the maximum for this modulus of 117 bytes.
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter.CreateKeyExchange (System.Byte[] rgbData) (at <eae584ce26bc40229c1b1aa476bfa589>:0)"
Here is a weapon from the database
0,2-0,3-0,8-0,42-0,21-0,19-0,9-0,22-0,20-0,0-0,6-0,12-0,7-0,5-0,10-0,13-0,11-0,4-0,1-0,17-0,49-0,50-0,51-0,53-0,45-
If I manually delete one weapon from the database
The purchase is successful.
Here is the whole mistake
CryptographicException: The data to be encrypted exceeds the maximum for this modulus of 117 bytes.
System.Security.Cryptography.RSAPKCS1KeyExchangeFormatter.CreateKeyExchange (System.Byte[] rgbData) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
System.Security.Cryptography.RSACryptoServiceProvider.Encrypt (System.Byte[] rgb, System.Boolean fOAEP) (at <eae584ce26bc40229c1b1aa476bfa589>:0)
bl_RSA.Encrypter (System.String data, System.String publicKey) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/General/bl_RSA.cs:26)
bl_DataBaseUtils.AddSecureField (UnityEngine.WWWForm wf, System.String key, System.String value) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/Utils/bl_DataBaseUtils.cs:221)
bl_ShopManager+<ProcessBuy>d__41.MoveNext () (at Assets/Addons/Shop/Scripts/Runtime/Core/bl_ShopManager.cs:277)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <10564ed154d647e194bef4aef8878649>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
bl_ShopManager:BuyCurrent() (at Assets/Addons/Shop/Scripts/Runtime/Core/bl_ShopManager.cs:255)
Sorry for the bad english.
CryptographicException: The data to be encrypted exceeds the maximum for this modulus of 117 bytes.
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
Hi,
Try the following:
- In the script bl_RSA.cs change the value of the constant 'KEY_LENGHT' to 2048
- in the script bl_Security.php (hosted on your server) -> function generateKeyPair() -> change this line:
to this:
That should do it,
Regards.
Try the following:
- In the script bl_RSA.cs change the value of the constant 'KEY_LENGHT' to 2048
- in the script bl_Security.php (hosted on your server) -> function generateKeyPair() -> change this line:
Code: Select all
$keys = $rsa->createKey();
Code: Select all
$keys = $rsa->createKey(2048);
Regards.
- ThePrimePillow
- Contributor
- Posts: 65
- Joined: Thu Feb 22, 2018 10:10 pm
I'm getting a similar error:Lovatto wrote: ↑Wed May 05, 2021 1:23 am Hi,
Try the following:
- In the script bl_RSA.cs change the value of the constant 'KEY_LENGHT' to 2048
- in the script bl_Security.php (hosted on your server) -> function generateKeyPair() -> change this line:to this:Code: Select all
$keys = $rsa->createKey();
That should do it,Code: Select all
$keys = $rsa->createKey(2048);
Regards.
Code: Select all
CryptographicException: Input string does not contain a valid encoding of the 'RSA' 'Modulus' parameter.
System.Security.Cryptography.RSA.FromXmlString (System.String xmlString) (at <437ba245d8404784b9fbab9b439ac908>:0)
bl_RSA.Encrypter (System.String data, System.String publicKey) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/General/bl_RSA.cs:23)
bl_DataBaseUtils.AddSecureField (UnityEngine.WWWForm wf, System.String key, System.String value) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/Utils/bl_DataBaseUtils.cs:221)
bl_LoginPro+<RegisterProcess>d__43.MoveNext () (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:461)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <480508088aee40cab70818ff164a29d5>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
bl_LoginPro:SinUp(String, String, String, String) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:444)
bl_SignUp:SignUp() (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/UI/bl_SignUp.cs:98)
UnityEngine.UI.Button:OnSubmit(BaseEventData)
MFPS.ULogin.bl_SubmitButton:Update() (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/UI/Navigation/bl_SubmitButton.cs:26)
Code: Select all
CryptographicException: Specified key is not a valid size for this algorithm.
System.Security.Cryptography.AsymmetricAlgorithm.set_KeySize (System.Int32 value) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Security.Cryptography.RSACryptoServiceProvider.Common (System.Int32 dwKeySize, System.Boolean parameters) (at <437ba245d8404784b9fbab9b439ac908>:0)
System.Security.Cryptography.RSACryptoServiceProvider..ctor (System.Int32 dwKeySize) (at <437ba245d8404784b9fbab9b439ac908>:0)
bl_RSA.Encrypter (System.String data, System.String publicKey) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/General/bl_RSA.cs:22)
bl_DataBaseUtils.AddSecureField (UnityEngine.WWWForm wf, System.String key, System.String value) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/Utils/bl_DataBaseUtils.cs:221)
bl_LoginPro+<RegisterProcess>d__43.MoveNext () (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:461)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <480508088aee40cab70818ff164a29d5>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
bl_LoginPro:SinUp(String, String, String, String) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:444)
bl_SignUp:SignUp() (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/UI/bl_SignUp.cs:98)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2019.3.13f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:377)
- Lovatto
- Admin
- Posts: 1834
- Joined: Sun Dec 07, 2014 3:18 pm
- Contact:
- ThePrimePillow
- Contributor
- Posts: 65
- Joined: Thu Feb 22, 2018 10:10 pm
Now im getting:
Code: Select all
CryptographicException: Input string does not contain a valid encoding of the 'RSA' 'Modulus' parameter.
System.Security.Cryptography.RSA.FromXmlString (System.String xmlString) (at <437ba245d8404784b9fbab9b439ac908>:0)
bl_RSA.Encrypter (System.String data, System.String publicKey) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/General/bl_RSA.cs:23)
bl_DataBaseUtils.AddSecureField (UnityEngine.WWWForm wf, System.String key, System.String value) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Internal/Utils/bl_DataBaseUtils.cs:221)
bl_LoginPro+<RegisterProcess>d__43.MoveNext () (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:461)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <480508088aee40cab70818ff164a29d5>:0)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
bl_LoginPro:SinUp(String, String, String, String) (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/Main/bl_LoginPro.cs:444)
bl_SignUp:SignUp() (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/UI/bl_SignUp.cs:98)
UnityEngine.UI.Button:OnSubmit(BaseEventData)
MFPS.ULogin.bl_SubmitButton:Update() (at Assets/Addons/ULoginSystemPro/Content/Scripts/Runtime/UI/Navigation/bl_SubmitButton.cs:26)
- ve_game
- Member
- Posts: 26
- Joined: Thu Jun 04, 2020 10:17 am
Thank you so much .Lovatto wrote: ↑Wed May 05, 2021 1:23 am Hi,
Try the following:
- In the script bl_RSA.cs change the value of the constant 'KEY_LENGHT' to 2048
- in the script bl_Security.php (hosted on your server) -> function generateKeyPair() -> change this line:to this:Code: Select all
$keys = $rsa->createKey();
That should do it,Code: Select all
$keys = $rsa->createKey(2048);
Regards.
Helped
- ve_game
- Member
- Posts: 26
- Joined: Thu Jun 04, 2020 10:17 am
Solved a problem
Increased the varchar values of the purchases varchar column by 600