Can't get C# RSA Decryption answerWhat is the difference between String and string in C#?Cast int to enum in C#How do I enumerate an enum in C#?Encrypt and decrypt a string in C#?What are the correct version numbers for C#?What is the difference between encrypting and signing in asymmetric encryption?Get int value from enum in C#Encrypt and Decrypt text with RSA in PHPC# RSA Decrypt Using Private KeyC# RSA encryption/decryption with transmission
The Amazing Sliding Crossword
Justifying Affordable Bespoke Spaceships
Counterfeit checks were created for my account. How does this type of fraud work?
Make symbols atomic, without losing their type
How to make all magic-casting innate, but still rare?
reverse a call to mmap()
Definition of 'vrit'
How can a clan of females defend themselves in the ancient world against wandering bands?
What kind of chart is this?
How can I prevent a user from copying files on another hard drive?
Why are there no file insertion syscalls
Are intrusions within a foreign embassy considered an act of war?
Why is it 出差去 and not 去出差?
Name for a function whose effect is canceled by another function?
Can the pre-order traversal of two different trees be the same even though they are different?
What is the most suitable position for a bishop here?
What does it cost to buy a tavern?
What mathematical theory is required for high frequency trading?
How would one carboxylate CBG into its acid form, CBGA?
How to modify a string without altering its text properties
How is the idea of "girlfriend material" naturally expressed in Russian?
If the mass of the Earth is decreasing by sending debris in space, does its angular momentum also decrease?
A conjecture concerning symmetric convex sets
Print the new site header
Can't get C# RSA Decryption answer
What is the difference between String and string in C#?Cast int to enum in C#How do I enumerate an enum in C#?Encrypt and decrypt a string in C#?What are the correct version numbers for C#?What is the difference between encrypting and signing in asymmetric encryption?Get int value from enum in C#Encrypt and Decrypt text with RSA in PHPC# RSA Decrypt Using Private KeyC# RSA encryption/decryption with transmission
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I am trying to encrypt and decrypt a string "Dilan" using C# RSA Encryption method. Although at the decrypting part I cannot get an answer. Then I use my keys in this page https://8gwifi.org/RSAFunctionality?keysize=2048 and try to get an answer.
From the encryption part,
Answer:
Decrypted plaintext: Dilan
Encripted plaintext: ODPcL+q4UaDlSo3CGBVww0DHnjv2AgBrr8gZD6HozQnyVoO03G01m9H/FAxQfiK9tFMRmxiMBMLnMMs53UxcSAa4XwCmOoxbOT6GeU+NUAIc1FtwckSQW+O/fB8Xg5OC2K7kaqX52Aa4xGN/I0yIXhJH7rrPHjUejbRnNeXOW1E=
For the https://8gwifi.org/RSAFunctionality?keysize=2048 page, I'm using
Public Key:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjARAj29gfyS6C7sQSjsJ
ulPGa9RMSntxJHvJRZG3KSo5lLKVLzFnIv0h6AMUOMQ/e0aic3LOd742ebKrxQdD
RA/as/zEqPOTh7t6ahQok33gjcn6+DP95RMfj85n0Cdm1GV0AjFdBhkYf189u1De
w6sSwUF2PhEky3wki7jR1UKWl7y7h0HEmsYhaDATBJYSz+3u1N5aN0X5gysv5KoP
QJ7D8Y8qNwFZFM39TUgeB4ZFT/QR853adNLinZ8/6rnkFZQO1BSChFXC0+2hB7/Z
4h9RAziLPXenmATvk8vxXXothRcKrP2n/mY8YrBfiGM8rvENdo/xqW0WEsFvZEbI
ywIDAQAB
-----END PUBLIC KEY-----
Private Key:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAjARAj29gfyS6C7sQSjsJulPGa9RMSntxJHvJRZG3KSo5lLKV
LzFnIv0h6AMUOMQ/e0aic3LOd742ebKrxQdDRA/as/zEqPOTh7t6ahQok33gjcn6
+DP95RMfj85n0Cdm1GV0AjFdBhkYf189u1Dew6sSwUF2PhEky3wki7jR1UKWl7y7
h0HEmsYhaDATBJYSz+3u1N5aN0X5gysv5KoPQJ7D8Y8qNwFZFM39TUgeB4ZFT/QR
853adNLinZ8/6rnkFZQO1BSChFXC0+2hB7/Z4h9RAziLPXenmATvk8vxXXothRcK
rP2n/mY8YrBfiGM8rvENdo/xqW0WEsFvZEbIywIDAQABAoIBAHCB9jKLZ3mi1FAa
xzMuj1mGeZkppQfwevC6+vcI6KmOQWiHuzKJuvs1depNlxEqO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/DlVImm6SXmnN1sAg2IBFQXTA8yof/TWhg841UFobxGN0plfWrwFW4ifl
AHnmBg32HZ2CxlQLDUKBdWWLSIHfL/RgHM4swxaueBxNbHRVKhWyCg==
-----END RSA PRIVATE KEY-----
String:
Dilan
C# Code:
using System;
using System.Security.Cryptography;
using System.Text;
namespace RSACSPSample
class RSACSPSample
static void Main()
string publicKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
string privateKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent><P>zSih4lMrHGBRq6PJPvYGevP8WbKAnQwERYi25K2zAIUrUdSWVVOQ7UjuVC1Tfw1Hg57Wal+/jTXjUcmRPgJr0Q==</P><Q>ivEEhXTAwQ2ZnSoEpiSlMW8Q/s6SB4agafZPpKajiOjqWv9y4E0OV1ZFe0GcbQlGgLAmfyWr5TgBYtr+ZJZbwQ==</Q><DP>izD2JEepCCeRQZJuB3mEDAddPr4M5IAypbqL27q9p6yyJ2LEXD/GJDdG+3WFIL4xtusdLi6oF3ZoNCU9lYSvAQ==</DP><DQ>D/Jt1Gt8HCxVb0Z9VhxqoWvgBX7sH9UB4GeW6Iz/xB0HmP4szzXI6ZlLTERRkeo4n1iYcot+WUa+UfxUqnLfgQ==</DQ><InverseQ>keZ+2rPqijIf0uW7MK7v9OHw7+eecPxXbbZAlDNxIUZeMdPuAR/JBUPPS2rqvIb0BJG28dwyaSAIaSfxqJoH4g==</InverseQ><D>SHIY0TGMEwkfkCF6Ywqqlan+t/cwsB9tWPI63rC8VZCbiLMJr+sqfFpLIOR9sB7hKCoyLU6IHfvlPDBDLmBVm8RVC9ytaUQewNj9cD5AB+YKGgh6p2oXpY7WcSRxgjqGIc2klPj3zyTrBn247kde3n5sD+wFY9KCTjPfllhpwAE=</D></RSAKeyValue>";
try
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create byte arrays to hold original, encrypted, and decrypted data.
byte[] dataToEncrypt = ByteConverter.GetBytes("Dilan");
byte[] encryptedData;
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Pass the data to ENCRYPT, the public key information
//(using RSACryptoServiceProvider.ExportParameters(false),
//and a boolean flag specifying no OAEP padding.
encryptedData = RSAEncrypt(dataToEncrypt, publicKey, false);
var base64 = Convert.ToBase64String(encryptedData);
//Pass the data to DECRYPT, the private key information
//(using RSACryptoServiceProvider.ExportParameters(true),
//and a boolean flag specifying no OAEP padding.
decryptedData = RSADecrypt(encryptedData, privateKey, false);
//Display the decrypted plaintext to the console.
Console.WriteLine("Decrypted plaintext: 0", ByteConverter.GetString(decryptedData));
Console.WriteLine("Encripted plaintext: 0", base64);
Console.ReadKey();
catch (ArgumentNullException)
//Catch this exception in case the encryption did
//not succeed.
Console.WriteLine("Encryption failed.");
public static byte[] RSAEncrypt(byte[] DataToEncrypt, string publicKey, bool DoOAEPPadding)
try
byte[] encryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This only needs
//to include the public key information.
RSA.FromXmlString(publicKey);
//Encrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding);
return encryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.Message);
return null;
public static byte[] RSADecrypt(byte[] DataToDecrypt, string privateKey, bool DoOAEPPadding)
try
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This needs
//to include the private key information.
RSA.FromXmlString(privateKey);
//Decrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
return decryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.ToString());
return null;
c# encryption rsa
add a comment |
I am trying to encrypt and decrypt a string "Dilan" using C# RSA Encryption method. Although at the decrypting part I cannot get an answer. Then I use my keys in this page https://8gwifi.org/RSAFunctionality?keysize=2048 and try to get an answer.
From the encryption part,
Answer:
Decrypted plaintext: Dilan
Encripted plaintext: ODPcL+q4UaDlSo3CGBVww0DHnjv2AgBrr8gZD6HozQnyVoO03G01m9H/FAxQfiK9tFMRmxiMBMLnMMs53UxcSAa4XwCmOoxbOT6GeU+NUAIc1FtwckSQW+O/fB8Xg5OC2K7kaqX52Aa4xGN/I0yIXhJH7rrPHjUejbRnNeXOW1E=
For the https://8gwifi.org/RSAFunctionality?keysize=2048 page, I'm using
Public Key:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjARAj29gfyS6C7sQSjsJ
ulPGa9RMSntxJHvJRZG3KSo5lLKVLzFnIv0h6AMUOMQ/e0aic3LOd742ebKrxQdD
RA/as/zEqPOTh7t6ahQok33gjcn6+DP95RMfj85n0Cdm1GV0AjFdBhkYf189u1De
w6sSwUF2PhEky3wki7jR1UKWl7y7h0HEmsYhaDATBJYSz+3u1N5aN0X5gysv5KoP
QJ7D8Y8qNwFZFM39TUgeB4ZFT/QR853adNLinZ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PpjU5oNJmlH8cBUVkBsE1L10R2XXBXJLzS8ZRHU
GJfp0wearV/yCIjaCH7ZpgOe1Hin40xBiqW2tsNidnhp8tj0zzWjJ4q6phSAkMUt
4Ep6mBYmr7orTzJbbWFg0h1PMbcLA2lVDhguBM8CgYABP0ELBGri1k/5958Q/2v9
HppmJ66pVKVXUk23DRCpAs+N3DJh6S8aXm+DqQZ+VQdVG4tJmQ1c7OsJcp3mk0lO
DHJQORALw9vHU/hCukCHUTyZl/bjr87a4mrphaGuau0rO8DWnhuaFhIT6A6pCmSb
3tGpT5+pMCCWWyGJP8+o9QKBgQCh6ub4j2fQ5znHVSuBQ+dLM4jvwE/vNC1hGHXy
ta5t1lh+dijMpJva4L2PSUx/7MGptaMzmyFnNOcgCC9SuvvxTcHfxsPdFQ1fZxQM
zzqkpRfK3yxHDAH7hayo7hJdtc1DSf6GRXKmCoI2v2BgYvUd+C0MBp9OKLo4sGC7
pYGNLwKBgQCFNf6D3WCTNSI51V5PXST6Ygzwp7rgL29jh7Icqd9X6zQKLtedY6lf
jqoLwo9/DlVImm6SXmnN1sAg2IBFQXTA8yof/TWhg841UFobxGN0plfWrwFW4ifl
AHnmBg32HZ2CxlQLDUKBdWWLSIHfL/RgHM4swxaueBxNbHRVKhWyCg==
-----END RSA PRIVATE KEY-----
String:
Dilan
C# Code:
using System;
using System.Security.Cryptography;
using System.Text;
namespace RSACSPSample
class RSACSPSample
static void Main()
string publicKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
string privateKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent><P>zSih4lMrHGBRq6PJPvYGevP8WbKAnQwERYi25K2zAIUrUdSWVVOQ7UjuVC1Tfw1Hg57Wal+/jTXjUcmRPgJr0Q==</P><Q>ivEEhXTAwQ2ZnSoEpiSlMW8Q/s6SB4agafZPpKajiOjqWv9y4E0OV1ZFe0GcbQlGgLAmfyWr5TgBYtr+ZJZbwQ==</Q><DP>izD2JEepCCeRQZJuB3mEDAddPr4M5IAypbqL27q9p6yyJ2LEXD/GJDdG+3WFIL4xtusdLi6oF3ZoNCU9lYSvAQ==</DP><DQ>D/Jt1Gt8HCxVb0Z9VhxqoWvgBX7sH9UB4GeW6Iz/xB0HmP4szzXI6ZlLTERRkeo4n1iYcot+WUa+UfxUqnLfgQ==</DQ><InverseQ>keZ+2rPqijIf0uW7MK7v9OHw7+eecPxXbbZAlDNxIUZeMdPuAR/JBUPPS2rqvIb0BJG28dwyaSAIaSfxqJoH4g==</InverseQ><D>SHIY0TGMEwkfkCF6Ywqqlan+t/cwsB9tWPI63rC8VZCbiLMJr+sqfFpLIOR9sB7hKCoyLU6IHfvlPDBDLmBVm8RVC9ytaUQewNj9cD5AB+YKGgh6p2oXpY7WcSRxgjqGIc2klPj3zyTrBn247kde3n5sD+wFY9KCTjPfllhpwAE=</D></RSAKeyValue>";
try
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create byte arrays to hold original, encrypted, and decrypted data.
byte[] dataToEncrypt = ByteConverter.GetBytes("Dilan");
byte[] encryptedData;
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Pass the data to ENCRYPT, the public key information
//(using RSACryptoServiceProvider.ExportParameters(false),
//and a boolean flag specifying no OAEP padding.
encryptedData = RSAEncrypt(dataToEncrypt, publicKey, false);
var base64 = Convert.ToBase64String(encryptedData);
//Pass the data to DECRYPT, the private key information
//(using RSACryptoServiceProvider.ExportParameters(true),
//and a boolean flag specifying no OAEP padding.
decryptedData = RSADecrypt(encryptedData, privateKey, false);
//Display the decrypted plaintext to the console.
Console.WriteLine("Decrypted plaintext: 0", ByteConverter.GetString(decryptedData));
Console.WriteLine("Encripted plaintext: 0", base64);
Console.ReadKey();
catch (ArgumentNullException)
//Catch this exception in case the encryption did
//not succeed.
Console.WriteLine("Encryption failed.");
public static byte[] RSAEncrypt(byte[] DataToEncrypt, string publicKey, bool DoOAEPPadding)
try
byte[] encryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This only needs
//to include the public key information.
RSA.FromXmlString(publicKey);
//Encrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding);
return encryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.Message);
return null;
public static byte[] RSADecrypt(byte[] DataToDecrypt, string privateKey, bool DoOAEPPadding)
try
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This needs
//to include the private key information.
RSA.FromXmlString(privateKey);
//Decrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
return decryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.ToString());
return null;
c# encryption rsa
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36
add a comment |
I am trying to encrypt and decrypt a string "Dilan" using C# RSA Encryption method. Although at the decrypting part I cannot get an answer. Then I use my keys in this page https://8gwifi.org/RSAFunctionality?keysize=2048 and try to get an answer.
From the encryption part,
Answer:
Decrypted plaintext: Dilan
Encripted plaintext: ODPcL+q4UaDlSo3CGBVww0DHnjv2AgBrr8gZD6HozQnyVoO03G01m9H/FAxQfiK9tFMRmxiMBMLnMMs53UxcSAa4XwCmOoxbOT6GeU+NUAIc1FtwckSQW+O/fB8Xg5OC2K7kaqX52Aa4xGN/I0yIXhJH7rrPHjUejbRnNeXOW1E=
For the https://8gwifi.org/RSAFunctionality?keysize=2048 page, I'm using
Public Key:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjARAj29gfyS6C7sQSjsJ
ulPGa9RMSntxJHvJRZG3KSo5lLKVLzFnIv0h6AMUOMQ/e0aic3LOd742ebKrxQdD
RA/as/zEqPOTh7t6ahQok33gjcn6+DP95RMfj85n0Cdm1GV0AjFdBhkYf189u1De
w6sSwUF2PhEky3wki7jR1UKWl7y7h0HEmsYhaDATBJYSz+3u1N5aN0X5gysv5KoP
QJ7D8Y8qNwFZFM39TUgeB4ZFT/QR853adNLinZ8/6rnkFZQO1BSChFXC0+2hB7/Z
4h9RAziLPXenmATvk8vxXXothRcKrP2n/mY8YrBfiGM8rvENdo/xqW0WEsFvZEbI
ywIDAQAB
-----END PUBLIC KEY-----
Private Key:
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAjARAj29gfyS6C7sQSjsJulPGa9RMSntxJHvJRZG3KSo5lLKV
LzFnIv0h6AMUOMQ/e0aic3LOd742ebKrxQdDRA/as/zEqPOTh7t6ahQok33gjcn6
+DP95RMfj85n0Cdm1GV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T6A6pCmSb
3tGpT5+pMCCWWyGJP8+o9QKBgQCh6ub4j2fQ5znHVSuBQ+dLM4jvwE/vNC1hGHXy
ta5t1lh+dijMpJva4L2PSUx/7MGptaMzmyFnNOcgCC9SuvvxTcHfxsPdFQ1fZxQM
zzqkpRfK3yxHDAH7hayo7hJdtc1DSf6GRXKmCoI2v2BgYvUd+C0MBp9OKLo4sGC7
pYGNLwKBgQCFNf6D3WCTNSI51V5PXST6Ygzwp7rgL29jh7Icqd9X6zQKLtedY6lf
jqoLwo9/DlVImm6SXmnN1sAg2IBFQXTA8yof/TWhg841UFobxGN0plfWrwFW4ifl
AHnmBg32HZ2CxlQLDUKBdWWLSIHfL/RgHM4swxaueBxNbHRVKhWyCg==
-----END RSA PRIVATE KEY-----
String:
Dilan
C# Code:
using System;
using System.Security.Cryptography;
using System.Text;
namespace RSACSPSample
class RSACSPSample
static void Main()
string publicKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
string privateKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent><P>zSih4lMrHGBRq6PJPvYGevP8WbKAnQwERYi25K2zAIUrUdSWVVOQ7UjuVC1Tfw1Hg57Wal+/jTXjUcmRPgJr0Q==</P><Q>ivEEhXTAwQ2ZnSoEpiSlMW8Q/s6SB4agafZPpKajiOjqWv9y4E0OV1ZFe0GcbQlGgLAmfyWr5TgBYtr+ZJZbwQ==</Q><DP>izD2JEepCCeRQZJuB3mEDAddPr4M5IAypbqL27q9p6yyJ2LEXD/GJDdG+3WFIL4xtusdLi6oF3ZoNCU9lYSvAQ==</DP><DQ>D/Jt1Gt8HCxVb0Z9VhxqoWvgBX7sH9UB4GeW6Iz/xB0HmP4szzXI6ZlLTERRkeo4n1iYcot+WUa+UfxUqnLfgQ==</DQ><InverseQ>keZ+2rPqijIf0uW7MK7v9OHw7+eecPxXbbZAlDNxIUZeMdPuAR/JBUPPS2rqvIb0BJG28dwyaSAIaSfxqJoH4g==</InverseQ><D>SHIY0TGMEwkfkCF6Ywqqlan+t/cwsB9tWPI63rC8VZCbiLMJr+sqfFpLIOR9sB7hKCoyLU6IHfvlPDBDLmBVm8RVC9ytaUQewNj9cD5AB+YKGgh6p2oXpY7WcSRxgjqGIc2klPj3zyTrBn247kde3n5sD+wFY9KCTjPfllhpwAE=</D></RSAKeyValue>";
try
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create byte arrays to hold original, encrypted, and decrypted data.
byte[] dataToEncrypt = ByteConverter.GetBytes("Dilan");
byte[] encryptedData;
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Pass the data to ENCRYPT, the public key information
//(using RSACryptoServiceProvider.ExportParameters(false),
//and a boolean flag specifying no OAEP padding.
encryptedData = RSAEncrypt(dataToEncrypt, publicKey, false);
var base64 = Convert.ToBase64String(encryptedData);
//Pass the data to DECRYPT, the private key information
//(using RSACryptoServiceProvider.ExportParameters(true),
//and a boolean flag specifying no OAEP padding.
decryptedData = RSADecrypt(encryptedData, privateKey, false);
//Display the decrypted plaintext to the console.
Console.WriteLine("Decrypted plaintext: 0", ByteConverter.GetString(decryptedData));
Console.WriteLine("Encripted plaintext: 0", base64);
Console.ReadKey();
catch (ArgumentNullException)
//Catch this exception in case the encryption did
//not succeed.
Console.WriteLine("Encryption failed.");
public static byte[] RSAEncrypt(byte[] DataToEncrypt, string publicKey, bool DoOAEPPadding)
try
byte[] encryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This only needs
//to include the public key information.
RSA.FromXmlString(publicKey);
//Encrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding);
return encryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.Message);
return null;
public static byte[] RSADecrypt(byte[] DataToDecrypt, string privateKey, bool DoOAEPPadding)
try
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This needs
//to include the private key information.
RSA.FromXmlString(privateKey);
//Decrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
return decryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.ToString());
return null;
c# encryption rsa
I am trying to encrypt and decrypt a string "Dilan" using C# RSA Encryption method. Although at the decrypting part I cannot get an answer. Then I use my keys in this page https://8gwifi.org/RSAFunctionality?keysize=2048 and try to get an answer.
From the encryption part,
Answer:
Decrypted plaintext: Dilan
Encripted plaintext: ODPcL+q4UaDlSo3CGBVww0DHnjv2AgBrr8gZD6HozQnyVoO03G01m9H/FAxQfiK9tFMRmxiMBMLnMMs53UxcSAa4XwCmOoxbOT6GeU+NUAIc1FtwckSQW+O/fB8Xg5OC2K7kaqX52Aa4xGN/I0yIXhJH7rrPHjUejbRnNeXOW1E=
For the https://8gwifi.org/RSAFunctionality?keysize=2048 page, I'm using
Public Key:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9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dnjkXPF4lIP8lJ0Q4+HTGisGFaeZhiDRenuAxY8pUtLA/uVy8IUE8pNje0m
iOWr6hkCgYEAvoN0hopinQ9nZv7TnTuqZJrdPrSzoBvZyhToV5bNUqF0w5S7cIZG
JepyoXDf/VPwkO7uLr+HciT5p3nxMjzLr+OSmZXw+pKGYIVsbOl6EvSc1yl2itvs
H8osH1rTRi5MekjYPW6G+m8XQlF+kQnvctQop9pjiunJY3ynUCuB80UCgYEAvCU9
y4genKb0MmCXl9HjFT3MUQjaoPpjU5oNJmlH8cBUVkBsE1L10R2XXBXJLzS8ZRHU
GJfp0wearV/yCIjaCH7ZpgOe1Hin40xBiqW2tsNidnhp8tj0zzWjJ4q6phSAkMUt
4Ep6mBYmr7orTzJbbWFg0h1PMbcLA2lVDhguBM8CgYABP0ELBGri1k/5958Q/2v9
HppmJ66pVKVXUk23DRCpAs+N3DJh6S8aXm+DqQZ+VQdVG4tJmQ1c7OsJcp3mk0lO
DHJQORALw9vHU/hCukCHUTyZl/bjr87a4mrphaGuau0rO8DWnhuaFhIT6A6pCmSb
3tGpT5+pMCCWWyGJP8+o9QKBgQCh6ub4j2fQ5znHVSuBQ+dLM4jvwE/vNC1hGHXy
ta5t1lh+dijMpJva4L2PSUx/7MGptaMzmyFnNOcgCC9SuvvxTcHfxsPdFQ1fZxQM
zzqkpRfK3yxHDAH7hayo7hJdtc1DSf6GRXKmCoI2v2BgYvUd+C0MBp9OKLo4sGC7
pYGNLwKBgQCFNf6D3WCTNSI51V5PXST6Ygzwp7rgL29jh7Icqd9X6zQKLtedY6lf
jqoLwo9/DlVImm6SXmnN1sAg2IBFQXTA8yof/TWhg841UFobxGN0plfWrwFW4ifl
AHnmBg32HZ2CxlQLDUKBdWWLSIHfL/RgHM4swxaueBxNbHRVKhWyCg==
-----END RSA PRIVATE KEY-----
String:
Dilan
C# Code:
using System;
using System.Security.Cryptography;
using System.Text;
namespace RSACSPSample
class RSACSPSample
static void Main()
string publicKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
string privateKey = "<RSAKeyValue><Modulus>b1kOI/0aD04EL6brX81csy3xaSAKOezF1n/g+mbyTR4rYQMWl4QMiG8XHx8E1KgERNjenbwePO0YcqH0FJP01sDPfiqleLK7FcoXJ00K9COcBCOzBf3OlSmpGYaPQ00O9pMGxXjyOc8a/wef//dPXIeXBeTxMrkR99vScWyck5E=</Modulus><Exponent>AQAB</Exponent><P>zSih4lMrHGBRq6PJPvYGevP8WbKAnQwERYi25K2zAIUrUdSWVVOQ7UjuVC1Tfw1Hg57Wal+/jTXjUcmRPgJr0Q==</P><Q>ivEEhXTAwQ2ZnSoEpiSlMW8Q/s6SB4agafZPpKajiOjqWv9y4E0OV1ZFe0GcbQlGgLAmfyWr5TgBYtr+ZJZbwQ==</Q><DP>izD2JEepCCeRQZJuB3mEDAddPr4M5IAypbqL27q9p6yyJ2LEXD/GJDdG+3WFIL4xtusdLi6oF3ZoNCU9lYSvAQ==</DP><DQ>D/Jt1Gt8HCxVb0Z9VhxqoWvgBX7sH9UB4GeW6Iz/xB0HmP4szzXI6ZlLTERRkeo4n1iYcot+WUa+UfxUqnLfgQ==</DQ><InverseQ>keZ+2rPqijIf0uW7MK7v9OHw7+eecPxXbbZAlDNxIUZeMdPuAR/JBUPPS2rqvIb0BJG28dwyaSAIaSfxqJoH4g==</InverseQ><D>SHIY0TGMEwkfkCF6Ywqqlan+t/cwsB9tWPI63rC8VZCbiLMJr+sqfFpLIOR9sB7hKCoyLU6IHfvlPDBDLmBVm8RVC9ytaUQewNj9cD5AB+YKGgh6p2oXpY7WcSRxgjqGIc2klPj3zyTrBn247kde3n5sD+wFY9KCTjPfllhpwAE=</D></RSAKeyValue>";
try
//Create a UnicodeEncoder to convert between byte array and string.
UnicodeEncoding ByteConverter = new UnicodeEncoding();
//Create byte arrays to hold original, encrypted, and decrypted data.
byte[] dataToEncrypt = ByteConverter.GetBytes("Dilan");
byte[] encryptedData;
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider to generate
//public and private key data.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Pass the data to ENCRYPT, the public key information
//(using RSACryptoServiceProvider.ExportParameters(false),
//and a boolean flag specifying no OAEP padding.
encryptedData = RSAEncrypt(dataToEncrypt, publicKey, false);
var base64 = Convert.ToBase64String(encryptedData);
//Pass the data to DECRYPT, the private key information
//(using RSACryptoServiceProvider.ExportParameters(true),
//and a boolean flag specifying no OAEP padding.
decryptedData = RSADecrypt(encryptedData, privateKey, false);
//Display the decrypted plaintext to the console.
Console.WriteLine("Decrypted plaintext: 0", ByteConverter.GetString(decryptedData));
Console.WriteLine("Encripted plaintext: 0", base64);
Console.ReadKey();
catch (ArgumentNullException)
//Catch this exception in case the encryption did
//not succeed.
Console.WriteLine("Encryption failed.");
public static byte[] RSAEncrypt(byte[] DataToEncrypt, string publicKey, bool DoOAEPPadding)
try
byte[] encryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This only needs
//to include the public key information.
RSA.FromXmlString(publicKey);
//Encrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
encryptedData = RSA.Encrypt(DataToEncrypt, DoOAEPPadding);
return encryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.Message);
return null;
public static byte[] RSADecrypt(byte[] DataToDecrypt, string privateKey, bool DoOAEPPadding)
try
byte[] decryptedData;
//Create a new instance of RSACryptoServiceProvider.
using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider())
//Import the RSA Key information. This needs
//to include the private key information.
RSA.FromXmlString(privateKey);
//Decrypt the passed byte array and specify OAEP padding.
//OAEP padding is only available on Microsoft Windows XP or
//later.
decryptedData = RSA.Decrypt(DataToDecrypt, DoOAEPPadding);
return decryptedData;
//Catch and display a CryptographicException
//to the console.
catch (CryptographicException e)
Console.WriteLine(e.ToString());
return null;
c# encryption rsa
c# encryption rsa
asked Mar 25 at 6:11
Sahan UdugampolaSahan Udugampola
1
1
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36
add a comment |
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332122%2fcant-get-c-sharp-rsa-decryption-answer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55332122%2fcant-get-c-sharp-rsa-decryption-answer%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
"Although at the decrypting part I cannot get an answer." - What? What does that mean?
– John
Mar 25 at 6:13
This given c# code gives encrypted output but I cannot decrypt it using 8gwifi.org/RSAFunctionality?keysize=2048 with the private key. @John
– Sahan Udugampola
Mar 25 at 6:24
@John There is no exception in the code but output can't be decrypted by the given website ** 8gwifi.org/RSAFunctionality?keysize=2048 **
– Sahan Udugampola
Mar 25 at 6:36