News for hackers. Stuff that matters.
Re:Primg – Generate prime numbers whose binary representatio... by ars on Monday January 29, 2018 @05:47PM (#16261315)
Can you use this for encryption? Make the decryption key the prime number generated by this, and you unlock it by pointing the camera at the right thing?
Re:Primg – Generate prime numbers whose binary representatio... by adrusi on Monday January 29, 2018 @06:19PM (#16261494)
I suppose if you have a very good camera, and are super-humanly precise at aiming the camera, and you have perfectly consistent lighting, then maybe.
Re:Primg – Generate prime numbers whose binary representatio... by redfast00 on Monday January 29, 2018 @06:19PM (#16261502)
No, not really: if you take a picture of something, it won't have the exact same pixel values every time you take it. A QR code would be way easier.
Re:Primg – Generate prime numbers whose binary representatio... by ars on Monday January 29, 2018 @06:21PM (#16261512)
It's scaled to 32x32 black and white. The pixel values don't have to be that similar, only reasonable close.
Re:Primg – Generate prime numbers whose binary representatio... by progval on Monday January 29, 2018 @06:37PM (#16261617)
But that's only 1024 bits, assuming values of each pixel is independant from its neighbors. Which it isn't, so you are well under 1024 bits.
Re:Primg – Generate prime numbers whose binary representatio... by Cyberdog on Monday January 29, 2018 @06:28PM (#16261562)
But then I'm guessing it fudges pixels/bits until it ends up with a prime number. Is that fudging deterministic, or just random?
Re:Primg – Generate prime numbers whose binary representatio... by progval on Monday January 29, 2018 @06:36PM (#16261610)
It tests primality of numbers greater than the number corresponding to the input image by incrementing. So it's deterministic.
Re:Primg – Generate prime numbers whose binary representatio... by esnard on Tuesday January 30, 2018 @05:24AM (#16264209)
Actually it's decrementing: https://github.com/geonnave/primg/blob/master/index.html#L82

I guess it could change the whole image if the last pixels are "000...000", which happens when the top-left corner has an opposite color to the bottom-right one.

This image can't be "primed" correctly, for example: https://i.imgur.com/ms3sXtF.png

Re:Primg – Generate prime numbers whose binary representatio... by Cyberdog on Monday January 29, 2018 @06:49PM (#16261682)
Incrementing… So pixels at the bottom right of the image are the most likely to be flipped from the source image. Interesting. (Edit: Assuming big-endianness and left-to-right, top-to-bottom printing of the pixels/bits)

Nonetheless, yes, using this to create security keys would probably be a good way to lose your bitcoin. :D

Re:Primg – Generate prime numbers whose binary representatio... by ars on Monday January 29, 2018 @06:58PM (#16261735)
Clearly the current implementation is not enough, but I wonder if there is a way to do this properly with actual security, and yet be reproducible for a normal human (we can assume the same camera and lighting).

Maybe some kind of marker in the image that is used for cropping and scaling?

Being able to see a particular image, and at a particular time of day (or indoors I guess), would definitely be an interesting security key.

(Hollywood: feel free to take this idea and do it badly :)

Re:Primg – Generate prime numbers whose binary representatio... by jwilk on Tuesday January 30, 2018 @11:50AM (#16266783)
Huh? Why do you want the decryption key to be prime?
Re:Primg – Generate prime numbers whose binary representatio... by ars on Tuesday January 30, 2018 @03:17PM (#16268616)
That's how RSA encryption works.