TOKEN GENERATE:-
token 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.
KEY GENERATE:-
? key 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.
IV GENERATE :-
? iv An un-encoded 16-digit initialization vector to be passed used for encrypting the JSON string
please help me!......
Rajkiran SwainPosted Apr 29, 2023, 4:00 PM
For generating a token using the RSA algorithm:
For generating a key using the RSA algorithm:
For generating an IV:
TarunPosted May 8, 2023, 6:27 AM
How To Generate Token With Using of PublicKey and Json String
I am using so many codes but not working .
I am using this code but xmlsting(public key )here i am got error
string json = "{\"key1\":\"value1\",\"key2\":\"value2\"}"; // The JSON string to be signed
string privateKey = "... ... ... ... ... ... "; // The private key used to sign the token RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
...
rsa.FromXmlString(privateKey);
byte[] jsonBytes = Encoding.UTF8.GetBytes(json);
byte[] signatureBytes = rsa.SignData(jsonBytes, new SHA1CryptoServiceProvider());
string token = Convert.ToBase64String(signatureBytes);
Console.WriteLine(token);
help me fast ! ..................
TarunPosted May 3, 2023, 10:56 AM
string publicKey = "... ... "; // The public key used to encrypt the key
string algorithmName = "AES"; // The symmetric algorithm to be used
int keySize = 128; // The size of the key in bits
string cipherModeName = "ECB"; // The cipher mode to be used
string paddingName = "PKCS1Padding"; // The padding mode to be used
byte[] keyBytes = new byte[keySize / 8];
using (RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider())
{
rng.GetBytes(keyBytes);
}
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString(publicKey); here error is come that error is(System.Security.XmlSyntaxException: 'Invalid syntax on line 1.)
byte[] encryptedKeyBytes = rsa.Encrypt(keyBytes, false);
string encryptedKey = Convert.ToBase64String(encryptedKeyBytes);
Console.WriteLine(encryptedKey);
please help me fast !......
Rajkiran SwainPosted May 3, 2023, 7:48 AM
TarunPosted May 3, 2023, 7:24 AM
How to Generating iv only Numbers in C# Please Help me Fast !.......
TarunPosted Apr 29, 2023, 6:42 AM
sir i want in asp.net C# not java please help me fast !..........
Rajkiran SwainPosted Apr 29, 2023, 5:45 AM