Click here to Skip to main content
15,897,226 members
Home / Discussions / C#
   

C#

 
GeneralAdd-in Solutions from Visual Studio .NET 2003 to 2005 Pin
rathishps3-May-05 23:28
rathishps3-May-05 23:28 
GeneralRe: Add-in Solutions from Visual Studio .NET 2003 to 2005 Pin
Judah Gabriel Himango4-May-05 4:35
sponsorJudah Gabriel Himango4-May-05 4:35 
GeneralRe: Add-in Solutions from Visual Studio .NET 2003 to 2005 Pin
rathishps6-May-05 2:17
rathishps6-May-05 2:17 
Generalchecking directory or file permission of network folders Pin
Xiao_M3-May-05 22:48
Xiao_M3-May-05 22:48 
GeneralCryptography Pin
Yaakov Davis3-May-05 22:36
Yaakov Davis3-May-05 22:36 
GeneralRe: Cryptography Pin
Trance Junkie4-May-05 4:13
Trance Junkie4-May-05 4:13 
GeneralRe: Cryptography Pin
Yaakov Davis4-May-05 4:46
Yaakov Davis4-May-05 4:46 
GeneralRe: Cryptography Pin
Enishi4-May-05 4:57
Enishi4-May-05 4:57 
Hi, i used this code i hope it helps u and u understand it

RSACryptoServiceProvider RSA;<br />
RSA = new RSACryptoServiceProvider();<br />
byte[] rawData, hash;<br />
HashAlgorithm HashMan;<br />
HashMan = new SHA1CryptoServiceProvider();<br />
rawData= System.Text.Encoding.Unicode.GetBytes(string PASSWORD); ///get the bytes of the original password<br />
hash = HashMan.ComputeHash(rawData); //uses the private key to generate the hash<br />
RSAPKCS1SignatureFormatter sf = new RSAPKCS1SignatureFormatter(RSA);   //this one will use the public key to encode it more                    <br />
sf.SetHashAlgorithm("SHA1");<br />
byte []FinalSignature= sf.CreateSignature(hash); //creates the signature, u will send this one to the receiver along with the public key<br />
<br />
RSA.ExportParameters(false); //this both sentences will give the public key, if u pass them true will give also the private key.<br />
RSA.ToXMLString(false);


ull send to the receiver the FinalSignature and the RSAParameters or the string with the public key.


in the receiver

<br />
//if u used the RSA.EXPORTPARAMETERS<br />
RSAPKCS1SignatureDeformatter sd=new RSAPKCS1SignatureDeformatter(parameters);<br />
// or if u used the xml string<br />
RSAPKCS1SignatureDeformatter sd=new RSAPKCS1SignatureDeformatter();<br />
sd.FromXMLString(string xmlParameters);<br />
//<br />
sd.SetHashAlgorithm("SHA1");<br />
bool pd=sd.VerifySignature(hashinurdatabase,FinalSignature);<br />
<br />


i hope it helps u with the code if u dont uderstand something or want to ask something just say here or emailme.

U will need to give to the SignatureDefformater the parameters of the RSACryptoServerProvider u used in the SignatuerDefformater or it will return u false.
GeneralRe: Cryptography Pin
Yaakov Davis4-May-05 7:44
Yaakov Davis4-May-05 7:44 
GeneralRe: Cryptography Pin
Enishi5-May-05 5:59
Enishi5-May-05 5:59 
GeneralsDataGrid Pin
Illegal Operation3-May-05 20:25
Illegal Operation3-May-05 20:25 
GeneralRe: sDataGrid Pin
V.3-May-05 23:47
professionalV.3-May-05 23:47 
GeneralRe: sDataGrid Pin
Illegal Operation4-May-05 19:50
Illegal Operation4-May-05 19:50 
GeneralRe: sDataGrid Pin
V.4-May-05 23:01
professionalV.4-May-05 23:01 
QuestionHow to add user Controls for Forms? Pin
pubududilena3-May-05 20:07
pubududilena3-May-05 20:07 
AnswerRe: How to add user Controls for Forms? Pin
Joshua Nussbaum3-May-05 20:14
Joshua Nussbaum3-May-05 20:14 
AnswerRe: How to add user Controls for Forms? Pin
spif20013-May-05 20:17
spif20013-May-05 20:17 
AnswerRe: How to add user Controls for Forms? Pin
pubududilena4-May-05 0:24
pubududilena4-May-05 0:24 
GeneralExecuting 2 Service classes in a single windows service Pin
rameedev3-May-05 19:44
rameedev3-May-05 19:44 
GeneralPreserving details of trial peiod in C# Pin
Anonymous3-May-05 19:36
Anonymous3-May-05 19:36 
GeneralRe: Preserving details of trial peiod in C# Pin
Christian Graus3-May-05 19:44
protectorChristian Graus3-May-05 19:44 
GeneralRe: Preserving details of trial peiod in C# Pin
Anonymous3-May-05 20:42
Anonymous3-May-05 20:42 
GeneralRich text box Pin
StephenMcAllister3-May-05 16:41
StephenMcAllister3-May-05 16:41 
GeneralRe: Rich text box Pin
Ali Iqbal Khan3-May-05 18:46
Ali Iqbal Khan3-May-05 18:46 
GeneralRe: Rich text box Pin
StephenMcAllister3-May-05 19:14
StephenMcAllister3-May-05 19:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.