Skip to content

Commit 76198b4

Browse files
committed
Remove duplicate hashes and add extra hints
1 parent 7dbaa49 commit 76198b4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

trainingportal/qna.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,15 @@ let base64Enc = (mes) => {
137137
let hashEnc = (mes) => {
138138
let words = mes.split(" ");
139139
let hashedWords = [];
140+
let hashes = [];
140141
for(let word of words){
141142
let hash = crypto.createHash('md5').update(word).digest('hex');
142-
hashedWords.push(hash);
143+
if(hashedWords.indexOf(word) === -1){
144+
hashedWords.push(word);
145+
hashes.push(hash);
146+
}
143147
}
144-
return getRes(mes, hashedWords.join("\n"));
148+
return getRes(hashedWords.join(" "), hashes.join("\n"));
145149
}
146150

147151
let xorEnc = (message) => {

trainingportal/static/lessons/cryptoBreaker/definitions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"name":"One-Way Hash",
4141
"description": "crypto_hash.md",
4242
"type":"quiz",
43-
"mission":"Find the text by cracking the digest of each word.",
43+
"mission":"Find the text by cracking the digest of each word. Make sure the words are entered in the same order, separated by spaces.",
4444
"codeBlockIds":[]
4545
},
4646
{

0 commit comments

Comments
 (0)