Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
BurdenOwl authored Nov 13, 2024
1 parent 3563f65 commit 0b09ff9
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<!DOCTYPE html>
<html lang="en">
<head id="lockDown2">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Locker 4</title>
<style>
.hidden {
display: none;
}
</style>
</head>
<body id="lockDown" class="hidden">

<p>I like food</p>

<script>
const previousFlag = "020dd3dc162a25483a5648c8ea007dc379ed5cb922f5cc7e4d2c48b3b69cc354";

const hashData = async (data) => {
const encodedData = new TextEncoder().encode(data);
const hashBuffer = await crypto.subtle.digest("SHA-256", encodedData);
return Array.prototype.slice.call(new Uint8Array(hashBuffer)).map(b => b.toString(16).padStart(2, '0')).join('');
};

const doubleCheck = async () => {
let question = prompt("To continue, please enter the previous");
let locked = document.getElementById('lockDown');
let locked2 = document.getElementById('lockDown2');
if (previousFlag !== await hashData(question.toUpperCase())) {
locked.innerHTML = ``;
locked2.innerHTML = ``;
return;
};
locked.classList.remove("hidden");
};

doubleCheck();
</script>
</body>
</html>

0 comments on commit 0b09ff9

Please sign in to comment.