Encrypt generated symmetric key of size 128 bits using banks public key with cipher algorithm Name/ MODE/ Padding for encryption using RSA / ECB / PKCS1Padding and convert the output to Base64 encoded string.
Public Key: a11b4f86cf186d127caa05db929d6f41
this is my code to generate symmetric key:
AesCryptoServiceProvider aes = new AesCryptoServiceProvider();
aes.GenerateKey();
string aesKeyBase64 = Convert.ToBase64String(aes.Key);
return aesKeyBase64;

Mohamed Azarudeen ZPosted May 18, 2023, 7:42 AM
Hi nagaveni try this
Nagaveni KatariPosted May 18, 2023, 9:11 AM
Token will be passed by signing the constructed plain JSON string with clients Private Key and convert the output to Base64 encoded string using algorithm SHA1withRSA.
private key:65e365bd06f7f54a5282a63278bb21c2
json string: "{\"UserID\":\"1\",\"UserName\":\"Ayyappa\",\"txnId\":\"123456\",\"customerMob\":\"8569896857\",\"lname\":\"lakshman\",\"name\":\"Balasubbiramani\",\"mname\":\"ram\",\"productCode\":\"DMT\",\"address\":\"Mumbai\",\"dateOfBirth\":\"05/10/1982\",\"agentId\":\"CUSTOMER123456\",\"partnerId\":\"761\",\"kycStatus\":\"0\",\"pancardStatus\":\"0\",\"identityDocType\":\"0\",\"identityDocNo\":\"BgQkkDr14...\",\"channel\":\"4\",\"isOTPValidated\":\"0\",\"hashKey\":\"9f3f9eb0451e8c2e3955551c57458072\"}";
has key has to generate please give the solution for the problum
Nagaveni KatariPosted May 18, 2023, 8:51 AM
Amit MohantyPosted May 18, 2023, 8:06 AM
To encrypt a generated symmetric key using a bank's public key with RSA encryption in ASP.NET, you can use the following code:
You can use the
EncryptSymmetricKeyWithRSAmethod by passing your generated symmetric key and the bank's public key as parameters. ThesymmetricKeyparameter should be in base64 string format, and thepublicKeyparameter should be the hex string representation of the bank's public key.For example: