Another option is to use
Message^(p+q) mod m = Message^(m+1) mod m
We know p+q is at least 2.sqrt(m)
I.e. the smallest sum of two numbers given their product is when each is equal.
Example p=k.sqrt (m), q=sqrt (m)/k , k is any number and product is m
So p+q = (k^2 +1)/k .sqrt (m)
Minimum when k=1 ...
Search found 148 matches
- Mon Oct 16, 2017 11:34 am
- Forum: Tricks 'n' Tips
- Topic: an observation
- Replies: 38
- Views: 18339
- Mon Oct 16, 2017 6:21 am
- Forum: Tricks 'n' Tips
- Topic: an observation
- Replies: 38
- Views: 18339
Re: an observation
The wiki has been updated to consider "something" as lcm (p-1)(q-1) or the reduced totient lcm (p-1)(q-1) and quotes a lower decryptor now "413"
- Thu Oct 27, 2016 2:21 pm
- Forum: Tricks 'n' Tips
- Topic: an observation
- Replies: 38
- Views: 18339
Re: an observation
Or it is just a bad encryptor in this case, normal ones take a value of "d" as the same number of digits as "m"
- Thu Oct 27, 2016 1:51 pm
- Forum: Tricks 'n' Tips
- Topic: an observation
- Replies: 38
- Views: 18339
Re: an observation
The point is that "d" is much easier to compute using the right shift method than computing "k"
"Something " will be LCM of p-1,q-1 ; obviously.
But the objective is to find "d" not p and q
"Something " will be LCM of p-1,q-1 ; obviously.
But the objective is to find "d" not p and q
- Thu Aug 18, 2016 6:48 am
- Forum: Tricks 'n' Tips
- Topic: an observation
- Replies: 38
- Views: 18339
Re: an observation
The first response to the algo above for the listed values is d=413, which too works as the decryption key
Note that any "something" and d, that satisifies
k.something+1=ed
is a possible solution because ed is congruent to 1 mod phi(pq) -- pq being product of 2 primes i.e k.something is congruent ...
Note that any "something" and d, that satisifies
k.something+1=ed
is a possible solution because ed is congruent to 1 mod phi(pq) -- pq being product of 2 primes i.e k.something is congruent ...
- Thu Jul 19, 2012 8:42 am
- Forum: Feature Requests and Wishlists
- Topic: selecting a CPU for a thread/process
- Replies: 6
- Views: 1639
selecting a CPU for a thread/process
Hi,
Is it possible to bind a cpu to a thread/process?
More like Bind_thread(cpu id, thread name etc)
I have seen this API some where in POSIX way back 2003/2004
http://lists.freebsd.org/pipermail/freebsd-hackers/2009-June/029012.html
However most of these too bind it to a "pseduo CPU" which is ...
Is it possible to bind a cpu to a thread/process?
More like Bind_thread(cpu id, thread name etc)
I have seen this API some where in POSIX way back 2003/2004
http://lists.freebsd.org/pipermail/freebsd-hackers/2009-June/029012.html
However most of these too bind it to a "pseduo CPU" which is ...
- Mon May 07, 2012 5:42 am
- Forum: Coding Questions
- Topic: Passing data between Threads
- Replies: 8
- Views: 2563
Re: Passing data between Threads
Back to back sockets are still the best, unless you plan to use a mutex to lock a common queue/array etc.
you will have to check the source and destn thread on each message if you use a common queue.
The easiest seems to be back to back IP loopback sockets, or create your own "in buffer" per thread ...
you will have to check the source and destn thread on each message if you use a common queue.
The easiest seems to be back to back IP loopback sockets, or create your own "in buffer" per thread ...
- Thu May 03, 2012 9:27 am
- Forum: Coding Questions
- Topic: fastest way to compare bit maps
- Replies: 12
- Views: 5324
Re: fastest way to compare bit maps
Thanks Braden!
i would kind of put a coin or some "scale" next to the images and ensure they end up being the same size prior to starting the match
So for example if the scale shows up as 5x5 pixels wide on one , and 4x4 pixels wide on the other, id simply reduce the size to match the smaller one ...
i would kind of put a coin or some "scale" next to the images and ensure they end up being the same size prior to starting the match
So for example if the scale shows up as 5x5 pixels wide on one , and 4x4 pixels wide on the other, id simply reduce the size to match the smaller one ...
- Wed May 02, 2012 10:11 am
- Forum: Coding Questions
- Topic: fastest way to compare bit maps
- Replies: 12
- Views: 5324
Re: fastest way to compare bit maps
Dont average out, simply put a range as to "if X percentage dots match, image matches else not" these are all black and white dots.
- Tue Apr 24, 2012 10:24 am
- Forum: Coding Questions
- Topic: fastest way to compare bit maps
- Replies: 12
- Views: 5324
Re: fastest way to compare bit maps
Not sure what the masters has to do with the algo,
The fastest I can think of is the 10x10 box running superficially over another 10x10 box and somehow finding say max 5x5 or a 6x6 part that is the same in both...even if 60 pixels out of 100 match, in a distributed image map, would it matter (I have ...
The fastest I can think of is the 10x10 box running superficially over another 10x10 box and somehow finding say max 5x5 or a 6x6 part that is the same in both...even if 60 pixels out of 100 match, in a distributed image map, would it matter (I have ...
- Tue Feb 21, 2012 6:53 am
- Forum: Coding Questions
- Topic: fastest way to compare bit maps
- Replies: 12
- Views: 5324
Re: fastest way to compare bit maps
Just want to compare 2 bit maps, black and white bit maps
Say like a finger print scanner.
@Braden:
CopyStructure(*Image\ValuesPointer + OutputWidth() * OutputHeight() * SizeOf(RGB) - SizeOf(RGB), @Max, RGB)
seems to break, im on an older version of PB
Say like a finger print scanner.
@Braden:
CopyStructure(*Image\ValuesPointer + OutputWidth() * OutputHeight() * SizeOf(RGB) - SizeOf(RGB), @Max, RGB)
seems to break, im on an older version of PB
- Thu Feb 16, 2012 8:53 am
- Forum: Coding Questions
- Topic: fastest way to compare bit maps
- Replies: 12
- Views: 5324
fastest way to compare bit maps
Hi,
I have to compare one 1024x1024 image with another 1024x1024 image
the idea is to compare "dot/no dot" or rather "1"s and "0"s with another set of 1s and 0s.
Was wondering if ASM is the best way to carry this out?
so if you have say 6x4 grid
101010
101010
101010
101010
, it should match
010101 ...
I have to compare one 1024x1024 image with another 1024x1024 image
the idea is to compare "dot/no dot" or rather "1"s and "0"s with another set of 1s and 0s.
Was wondering if ASM is the best way to carry this out?
so if you have say 6x4 grid
101010
101010
101010
101010
, it should match
010101 ...
- Mon Nov 14, 2011 9:16 am
- Forum: Feature Requests and Wishlists
- Topic: PureBasic for Solaris
- Replies: 40
- Views: 13112
Re: PureBasic for Solaris
Well Oracle Linux does work on SPARC and PB works on Linux so.... Sparc<->PB should work
- Mon May 23, 2011 7:21 am
- Forum: Coding Questions
- Topic: semaphore versus global
- Replies: 9
- Views: 2598
Re: semaphore versus global
I am not sure what you mean here but micros and board levels have no schedulers. It is always "each to his own".. remember back to back unix sockets? there is no "multicast socket" the writer has to write to all unicasts.
- Fri May 20, 2011 8:24 am
- Forum: Coding Questions
- Topic: semaphore versus global
- Replies: 9
- Views: 2598
Re: semaphore versus global
hmm but take this case
there is 1 "reader and 1 writer" per thread1-->thread 2 pair.
the reader thread has to check if readptr=writeptr else there is data to read, and the writer thread has to check if readtptr-1=writeptr else write..
in other words, like in case of microcontrollers of assembler ...
there is 1 "reader and 1 writer" per thread1-->thread 2 pair.
the reader thread has to check if readptr=writeptr else there is data to read, and the writer thread has to check if readtptr-1=writeptr else write..
in other words, like in case of microcontrollers of assembler ...