Bug 474444 - Pixelate function should add random noise too so it's truly secure
Summary: Pixelate function should add random noise too so it's truly secure
Status: CONFIRMED
Alias: None
Product: Spectacle
Classification: Applications
Component: General (show other bugs)
Version: 23.04.0
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Noah Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-12 09:31 UTC by Daniel Duris
Modified: 2023-09-12 19:58 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pixelated text (2.47 KB, image/png)
2023-09-12 19:21 UTC, Noah Davis
Details
test of pixelation - three times with number 161589 (36.94 KB, image/png)
2023-09-12 19:33 UTC, Daniel Duris
Details
Recording of using pixelation tool (161.37 KB, image/gif)
2023-09-12 19:41 UTC, Daniel Duris
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Duris 2023-09-12 09:31:31 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***
Pixelate needs random noise added instead of pixelating same text over with the same pixels. It is definitely not random as second pixelation does not even work (pixelate just does same pixels over and over instead of pixelating with random noise added).

STEPS TO REPRODUCE
1. Pixelate some text

OBSERVED RESULT
Text is note securely pixelated and can be reverse decoded

EXPECTED RESULT
Text is securely pixelated, i.e. with random noise added
Comment 1 Noah Davis 2023-09-12 19:21:26 UTC
Created attachment 161589 [details]
pixelated text

While I don't know that much about decoding pixelated images, are you sure it's possible to decode this? I know there's an issue where large text can't be securely pixelated, but that could be solved by adding an option to increase the pixelation.
Comment 2 Daniel Duris 2023-09-12 19:33:26 UTC
Created attachment 161590 [details]
test of pixelation - three times with number 161589
Comment 3 Daniel Duris 2023-09-12 19:36:29 UTC
(In reply to Noah Davis from comment #1)
> Created attachment 161589 [details]
> pixelated text
> 
> While I don't know that much about decoding pixelated images, are you sure
> it's possible to decode this? I know there's an issue where large text can't
> be securely pixelated, but that could be solved by adding an option to
> increase the pixelation.

So this is where it becomes weird. I have now added a test case where the same characters (6 digits: 161589) are pixelated in three different ways. But when I tried it on a different image - I was getting only black and white pixels instead of colors as here and I could reverse decode the number from standard sized text (e.g. around 12px).

The problem seems to be that there is only one pass of pixelization. When one tries to use the pixel tool again, it does nothing over already pixelized area. So it should be adding random noise + allowing user to do multiple passes.
Comment 4 Daniel Duris 2023-09-12 19:41:13 UTC
Created attachment 161591 [details]
Recording of using pixelation tool

See how the tool pixelizes in the same way over and over (I was doing Undo and redoing it). it seems like ti calculates the "random" pixels based on the x,y screen location?
Comment 5 Noah Davis 2023-09-12 19:48:07 UTC
The colors in the image I posted are probably just a result of subpixel text antialiasing.
Comment 6 Noah Davis 2023-09-12 19:58:26 UTC
> See how the tool pixelizes in the same way over and over (I was doing Undo and redoing it). it seems like ti calculates the "random" pixels based on the x,y screen location?

Yes, that was done so that you could connect different pixelated sections together seamlessly instead of having obvious edges where a new pixelate effect began. It looks nice, but I suppose it's not the most secure type of pixelate effect. Maybe if we want that kind of visual effect, it would make more sense for the pixelate tool to be a kind of brush? That way you could pixelate a non-rectangular area in one pass seamlessly and add additional layers of pixelation by starting another stroke. The trouble here is the annotation tools are useful for security, but are also intended to be used artistically. I figured anyone who truly cared about security would just paint over the text they want to hide since you can't recover information from a black rectangle (except for the estimated size of the string).