-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
75 additions
and
6 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
build/ | ||
.soupault-cache/ | ||
node_modules/ | ||
.key |
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
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
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
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 |
---|---|---|
|
@@ -8,4 +8,4 @@ tags: | |
|
||
## Test secret content | ||
|
||
Hello | ||
Hello world! |
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,27 @@ | ||
function fun() { | ||
const key = prompt("Enter the key"); | ||
if (key) { | ||
this.localStorage.setItem("key", key); | ||
location.reload(); | ||
} | ||
} | ||
|
||
window.addEventListener("load", function () { | ||
const enc = document.getElementsByTagName("encrypted")[0]; | ||
const val = enc.attributes.data.value; | ||
const key = this.localStorage.getItem("key"); | ||
if (!key) { | ||
document.getElementsByTagName("main")[0].innerHTML += | ||
'Error: No key provided. <a onclick="fun()">Click to enter the key.</a>'; | ||
return; | ||
} | ||
const decrypted = CryptoJS.AES.decrypt(val, key); | ||
const text = decrypted.toString(CryptoJS.enc.Utf8); | ||
enc.remove(); | ||
if (text.length == 0) { | ||
document.getElementsByTagName("main")[0].innerHTML += | ||
'Error: Incorrect key. <a onclick="fun()">Click to enter the key.</a>'; | ||
return; | ||
} | ||
document.getElementsByTagName("main")[0].innerHTML += text; | ||
}); |
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