|
Hi,
x = 2^(20 - a) or x = 2^a
Use log
log x = (20 - a) * log 2 or log x = a * log 2
Regards
|
|
|
|
|
Thanks!
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
you can do this:
if x=n^a
then a=log(x)/log(n)
Log is the logarithm ( base 10 or naturals, this works whith any base )
Greetings
|
|
|
|
|
Hi, probably a better place for this, hopefully someone can help.
For one of my programs i'm trying to impliment my own version of the RSA algorithm, the encryption works fine, however the decrption does not, even though it uses basically the same algorithm. The code is as follows:
<br />
<br />
<br />
#include <stdio.h><br />
#include <stdlib.h><br />
#include "math.h"<br />
<br />
<br />
int do_crypto(int M, int e, int N);<br />
<br />
int main()<br />
{<br />
<br />
printf("...\n");<br />
<br />
int p = 17;<br />
int q = 11;<br />
int e = 7;<br />
int N = p * q;
<br />
int M = 88;<br />
<br />
int C = do_crypto(M, e, N);
printf("C = %d \n", C);<br />
<br />
<br />
int d = ( ( (p-1) * (q-1) ) / e );<br />
printf("d = %d \n", d);<br />
<br />
<br />
int m = do_crypto(11, 23, 187);
printf("m = %d \n", m);<br />
<br />
<br />
return 0;<br />
}<br />
<br />
int do_crypto(int M, int e, int N)<br />
{<br />
int iret = int ( M * exp(e) ) % N;<br />
<br />
return iret;<br />
}<br />
<br />
When decrypting I have put in actual values for the keys etc, and the result should be 88.
The actual formulas are:
ENCRYPT: C = Me (Mod N)
DECRYPT: M = Cd (Mod N)
*** Please note the 'e' and 'd' are supposed to be superscript, e.g. raised to the power of...
|
|
|
|
|
Have you figured this out or still having trouble with it?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
i have a map that contain (22 * 18 ) images i don't want to add all of the images
i want have a 3 * 3 table
the problem is i want when user drag the map the images is load in the imagesboxes without user understand that all of the images dosn't load
How Can I do it(!!!!!)
MHF
|
|
|
|
|
Write a C program that accepts as input any of the following:
>> a listing of edges of a graph given as pairs of positive integers
>> the adjacency matrix
>> the incidence matrix
and outputs the other two...
|
|
|
|
|
robeelyn wrote:
Write a C program that accepts as input any of the following:
>> a listing of edges of a graph given as pairs of positive integers
>> the adjacency matrix
>> the incidence matrix
and outputs the other two...
What do you mean by this?
As of how to accomplish this, have you ever tried Google? Failing that try
|
|
|
|
|
Sounds like homework!
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
|
|
1) you don't ask a regular english question
2) this looks like homework
3) you didn't even choose the right forum
|
|
|
|
|
Hi everyone,
does anyone know where I can find a visual basic 6 code for wavelet image compression and decomposition ... I need it for my graduation project ... Help please ...
Luay Al-wesi
|
|
|
|
|
|
Yeah .. I did try google ... and yahoo
Luay Al-wesi
|
|
|
|
|
|
yeah I did ... I get this "The page you requested cannot be found"
Luay Al-wesi
|
|
|
|
|
|
I tried that .. no codes for Visual Basic ... I do have the C code for it ... but I need the Visual Basic code .. thanks anyway
Luay Al-wesi
|
|
|
|
|
luay1985 wrote: I do have the C code for it ... but I need the Visual Basic code
Then port it from C to VB. Shouldn't be that difficult
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
|
Actually it's in the Visual C++ code ... and I don't know that language ... and I'm not that deep into Visual basic
Luay Al-wesi
|
|
|
|
|
luay1985 wrote: ... and I don't know that language ...
Doesn't hurt to learn it
luay1985 wrote: it's in the Visual C++ code ... and I'm not that deep into Visual basic
Shouldn't be an issue. Just give it a try.
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|
|
I tried .. it's too big .. and most of the functions I didn't even hear of ... beside I'm learning Visual basic now .. and the project should be done before january.
thanks anyway ... I found one in VB .. not sure it's what I'm looking for .. but I will see about that
Luay Al-wesi
|
|
|
|
|
luay1985 wrote: I found one in VB .. not sure it's what I'm looking for .. but I will see about that
Good luck. Hope it's what your looking for -D
That's no moon, it's a space station. - Obi-wan Kenobi
|
|
|
|