I want to encrypt/decrypt some data with RSA. I have the private key (D and Modulus) and the public key (Exponent and Modulus) saved in text files.
When I tried to decrypt (encrypt data with private key) I tried to import RsaParameters with D and Modulus set to the values in the file and the other parameters set to null. On the Import method it throws a "Bad Data" Exception. It seems that I can only import RsaParameters when all of the parameters are set? Can I do it any other way?
I think that the error you are getting might be related to the length of the data you are trying to encrypt.
RSA was designed for encrypting/decrypting cryptographic keys, not data. I cannot remember off the top of my head the max length, but if you plough through the MSDN Documentation, it is in there somewhere.
As I said at the start this is only a MIGHT BE, but given that RSA has this length problem you would be better off switching to another encryption provider now, rather than wait till it breaks before doing so.
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
I'm using the above connection, together with a SELECT * FROM file statement, to pull in data from a comma-delimited text file, where dir is the directory where the file is located and file is the name of the csv file.
This works well for files that contain English characters only, but for any file that uses non-English (ASCII) characters, the expression fails.
I have written the csv file using a StreamWriter with Encoding=UTF8 so the characters display fine when viewed in Notepad or Excel, but when pulled into the DataTable, the value in the table is blank. Is there some Extended Property that can be used to permit East Asian characters, say, to be displayed properly? Thanks.
While downloading files from FTP server using WEBClient class, I'm able to download first file (while looping through all the files)to my local system after that i'm getting the error "The remote server returned an error: (530) Not logged in".
The credentials are correct as the first file is getting downloaded successfully
Following is the code
FileInfo fi = new FileInfo(strFileName);
if (!fi.Extension.ToLower().Equals(".csv")) return false;
if (serverUri.Scheme != Uri.UriSchemeFtp)
// Get the object used to communicate with the server.
using (WebClient request = new WebClient())
//request.Proxy = null;
//request.BaseAddress = serverUri.ToString();
// This example assumes the FTP site uses anonymous logon.
string strUsername, strPassword;
strUsername = this.FtpUserName;
strPassword = this.FtpPassword;
request.Credentials = new NetworkCredential(strUsername, strPassword);
string strListeningDir = "";
strListeningDir = this.ListeningDirectory;
I would like to know how to code a server to create an application in C # client / server.
The database used is SQL server, it contains 7 tables.
And more specifically how I can code a server in c # so that multiple users can simultaneously access and complete their treatment (addition, modification, deletion, printing, consulting, research)
I hope to have an answer because it will determine my future work.
Thank you in advance
Thank you for your help, and I would like to know how I can insert my access code to database sql, for example customer identification (login and password in the fields of the table)
Thank you once again
Check out the SqlCommand class, and create a SQL connection using System.Data.SqlClient.SqlConnection class, don't forget to check out this link[^] for information on how to construct a connection string.
Thank you for your help but I know how create a sql connection string but what I don't know is to manage the connection to a sql server database in a client/server application and any necessary treatment.
basically I want to clear the selection and keep a context menu from coming up if the user right clicks in empty space beneath the last row. The MouseDown event fires before the CellMouseDown event so I can't have the latter set a flag to control the former. The former gives a mouse coordinate but I don't see a way to check if it's on a row or not.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies