We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try to implement the library; the RSA encryption in a project, I copied the example and run the project but don´t work, It show me this error;
TypeError: System.Security.Cryptography.PaddingMode is undefined
This is the code that I used:
function GetNewRsaProvider(dwKeySize) { // Create a new instance of RSACryptoServiceProvider. if (!dwKeySize) dwKeySize = 512; return new System.Security.Cryptography.RSACryptoServiceProvider(dwKeySize); } function GetRsaKey(includePrivateParameters) { var keyParams = xmlParamsDefault; // ------------------------------------------------ // RSA Keys // ------------------------------------------------ var rsa = GetNewRsaProvider(); if (keyParams[0] === "<") { // Import parameters from xml. rsa.FromXmlString(keyParams); } else { var keyBlob = System.Convert.FromBase64String(keyParams); rsa.ImportCspBlob(keyBlob); } return rsa.ExportParameters(includePrivateParameters); } function fn_encriptar(Texto, Grifo) { var decryptedBytes = System.Text.Encoding.UTF8.GetBytes(Texto); var doOaepPadding = false; // ------------------------------------------------ // Encrypt // ------------------------------------------------ var rsa = GetNewRsaProvider(); // Import the RSA Key information. rsa.ImportParameters(GetRsaKey(false)); // Encrypt the passed byte array and specify OAEP padding. var encryptedBytes = rsa.Encrypt(decryptedBytes, doOaepPadding); var encryptedString = System.Convert.ToBase64String(encryptedBytes) // ------------------------------------------------ // Display the encrypted data. //var encryptedString = System.BitConverter.ToString(encryptedBytes, ""); return encryptedString; }
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I try to implement the library; the RSA encryption in a project, I copied the example and run the project but don´t work, It show me this error;
TypeError: System.Security.Cryptography.PaddingMode is undefined
This is the code that I used:
`
The text was updated successfully, but these errors were encountered: