-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9cc441
commit 37eaf06
Showing
14 changed files
with
3,316 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
node_modules | ||
dist | ||
*.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
# unredacter | ||
Unredact text that has been redacted using insecure methods | ||
# Unredacter | ||
|
||
Shows you why you should never ever ever use pixelation as a redaction technique. | ||
|
||
 | ||
|
||
## How to Try it Out | ||
|
||
Install the dependencies: | ||
|
||
`npm install` | ||
|
||
Then start with | ||
|
||
`npm start` | ||
|
||
That's it. | ||
|
||
## How to Crack Your Own Pixelated Image | ||
|
||
This is a bit manual and not at all streamlined. I think you'll see why. If someone feels like taking a shot at making this process more in-app, I'm all ears. What do I look like, an Electron developer? But yea here it is: | ||
|
||
1) Crop your image down to just the pixelated area. No borders, no other text. Replace `secret.png` with that. I recommend doing it in GiMP. | ||
|
||
2) Make note of the block size. (It's just size of each pixelated block) Replace `blockSize` in the code with that. | ||
|
||
3) Get the CSS just right. This is the hardest and most time-consuming part. Try entering it into `test.html` and view it in Chrome. Tweak it until you can replicate some sample text as exactly as possible. Pay particular attention to the word and letter spacing. If it skews, then it'll all mess up. Also the font-weight, or else things will end up too light or dark. I can't emphasize enough how critical this step is, as the whole thing really depends on being able to correctly replicate the redacted characters. | ||
|
||
4) Determine what character set you want to try. It's at the top of `preload.ts`. | ||
|
||
5) Press the go button and see if it works! |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.text-label { | ||
color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Unredacter</title> | ||
<meta | ||
http-equiv="Content-Security-Policy" | ||
content="default-src 'self'; script-src 'self'; img-src 'self' data:;" | ||
/> | ||
<meta | ||
http-equiv="X-Content-Security-Policy" | ||
content="default-src 'self'; script-src 'self'" | ||
/> | ||
<link rel="stylesheet" type="text/css" href="index.css"> | ||
</head> | ||
<body> | ||
<button id="start-button">Click to Start</button> | ||
|
||
<br><br> | ||
<label class="text-label">Redacted Text:</label> | ||
<br> | ||
<image id="original-image" src="secret.png"/> | ||
<br> | ||
<label class="text-label">Current Guess:</label> | ||
<br> | ||
<image id="current-preview-image" src=""/> | ||
<br> | ||
<input type="text" id="current-guess"> | ||
<br> | ||
<label class="text-label">Best Guess:</label> | ||
<br> | ||
<image id="best-preview-image" src=""/> | ||
<br> | ||
<input type="text" id="best-guess"> | ||
<br> | ||
<label class="text-label">Score (lower is better)</label> | ||
<input type="text" id="best-score"> | ||
<br> | ||
<label class="text-label">Offset X</label> | ||
<input type="text" id="offset_x"> | ||
<br> | ||
<label class="text-label">Offset Y</label> | ||
<input type="text" id="offset_y"> | ||
<br> | ||
<label class="text-label">Good offsets to try</label> | ||
<input type="text" id="offsets_to_try"> | ||
<br> | ||
|
||
<br><br><br> | ||
<label class="text-label">Make Your Own Redacted Text:</label> | ||
<br> | ||
<input type="text" placeholder="your secret phrase here" id="text_to_redact"> | ||
<br> | ||
<label class="text-label">Offset x</label> | ||
<input type="text" value="2" id="redacted_offset_x"> | ||
<br> | ||
<label class="text-label">Offset y</label> | ||
<input type="text" value="5" id="redacted_offset_y"> | ||
<br> | ||
<button id="redact-button">Redact Me</button> | ||
<image id="redacted_image" src=""/> | ||
<a id="download_link" href="path_to_file" download="redacted.png">Download</a> | ||
|
||
<!-- You can also require other files to run in this process --> | ||
<script src="./dist/renderer.js"></script> | ||
</body> | ||
</html> |
Oops, something went wrong.
37eaf06
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.