Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: I have a interesting question! Pin
Mazdak29-Jul-03 21:06
Mazdak29-Jul-03 21:06 
GeneralRe: I have a interesting question! Pin
Ista30-Jul-03 14:45
Ista30-Jul-03 14:45 
Generaloverride root/parent node in tree menu Pin
Sonia Jaiswal29-Jul-03 15:31
Sonia Jaiswal29-Jul-03 15:31 
GeneralRe: override root/parent node in tree menu Pin
StealthyMark30-Jul-03 17:57
StealthyMark30-Jul-03 17:57 
GeneralRe: override root/parent node in tree menu Pin
Sonia Jaiswal30-Jul-03 22:04
Sonia Jaiswal30-Jul-03 22:04 
GeneralQuerying Sharepoint server from dotnet Pin
worldspawn29-Jul-03 13:50
worldspawn29-Jul-03 13:50 
GeneralAutomation Pin
Nivitha29-Jul-03 12:30
Nivitha29-Jul-03 12:30 
GeneralRSA Question Pin
jtmtv1829-Jul-03 12:15
jtmtv1829-Jul-03 12:15 
im trying to implement the algorithm of RSA for fun...but im having a problem with the mod function in .net returning the wrong values.

the algorithm im using is.

Encrypt: value^e mod PQ
Decrypt: (x^e mod PQ)^d mod PQ= value;
A implementation i use is hard coded...and i have varifyed the values with the windows calculator and found that the awnser is returned correctly. Here is where is the code with the problem
<br />
double E  = 17 ;   <br />
double D  = 2753;<br />
double PQ = 3233;<br />
double P  = 61 ;   //<- first prime number (destroy this after computing E and D)<br />
double Q  = 53 ;   //<- second prime number (destroy this after computing E and D)<br />
//to encrypt i do this. the message/int to encrypt will be 123<br />
//(123^E) mod PQ = (123^17) mod 3233 = 855<br />
//the above code will return 855. try it in the windows calc and it will return it<br />
int i = Math.Pow(123,E)%PQ;<br />
//this above code..in .Net using the same logic as above , yet it returns me 922 ?? What am i doing wrong ? i have varifyed that Math.Pow(123,E) is raising the number to the correct value. but i think the problem lies in the mod function.<br />


May it be that my chosen key pairs and primes are in correct ? Thanks for your time peoples

Jesse M

The Code Project Is Your Friend...
GeneralRe: RSA Question Pin
Kastro30-Jul-03 7:16
Kastro30-Jul-03 7:16 
GeneralPrinting Access Database labels C# Pin
Anonymous29-Jul-03 12:12
Anonymous29-Jul-03 12:12 
GeneralRe: Printing Access Database labels C# Pin
Ista30-Jul-03 4:23
Ista30-Jul-03 4:23 
GeneralDeployment Project Pin
kgoodrich29-Jul-03 10:12
kgoodrich29-Jul-03 10:12 
GeneralPassing XmlResolver to Transform() method Pin
kyledunn29-Jul-03 10:08
kyledunn29-Jul-03 10:08 
GeneralRe: Passing XmlResolver to Transform() method Pin
Nick Parker29-Jul-03 12:52
protectorNick Parker29-Jul-03 12:52 
GeneralRe: Passing XmlResolver to Transform() method Pin
kyledunn7-Aug-03 8:39
kyledunn7-Aug-03 8:39 
GeneralCombo binding Pin
Ista29-Jul-03 9:10
Ista29-Jul-03 9:10 
Questiondatagrid how to disable new row?? Pin
mdolby29-Jul-03 9:02
mdolby29-Jul-03 9:02 
AnswerRe: datagrid how to disable new row?? Pin
Ista29-Jul-03 9:11
Ista29-Jul-03 9:11 
Generalwhich installer Pin
mdolby29-Jul-03 8:54
mdolby29-Jul-03 8:54 
GeneralRe: which installer Pin
Alex Korchemniy29-Jul-03 12:45
Alex Korchemniy29-Jul-03 12:45 
GeneralComboBox limiting editing Pin
Ista29-Jul-03 5:52
Ista29-Jul-03 5:52 
GeneralRe: ComboBox limiting editing Pin
Zachery29-Jul-03 6:03
Zachery29-Jul-03 6:03 
GeneralRe: ComboBox limiting editing Pin
Ista29-Jul-03 6:08
Ista29-Jul-03 6:08 
GeneralRe: ComboBox limiting editing Pin
Arjan Einbu29-Jul-03 6:45
Arjan Einbu29-Jul-03 6:45 
GeneralRe: ComboBox limiting editing Pin
Ista29-Jul-03 9:10
Ista29-Jul-03 9:10 

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.