diff --git a/trainingportal/qna.js b/trainingportal/qna.js index 66d4faa..da8f55e 100644 --- a/trainingportal/qna.js +++ b/trainingportal/qna.js @@ -137,11 +137,15 @@ let base64Enc = (mes) => { let hashEnc = (mes) => { let words = mes.split(" "); let hashedWords = []; + let hashes = []; for(let word of words){ let hash = crypto.createHash('md5').update(word).digest('hex'); - hashedWords.push(hash); + if(hashedWords.indexOf(word) === -1){ + hashedWords.push(word); + hashes.push(hash); + } } - return getRes(mes, hashedWords.join("\n")); + return getRes(hashedWords.join(" "), hashes.join("\n")); } let xorEnc = (message) => { diff --git a/trainingportal/static/lessons/cryptoBreaker/definitions.json b/trainingportal/static/lessons/cryptoBreaker/definitions.json index 8434c63..eb04270 100644 --- a/trainingportal/static/lessons/cryptoBreaker/definitions.json +++ b/trainingportal/static/lessons/cryptoBreaker/definitions.json @@ -40,7 +40,7 @@ "name":"One-Way Hash", "description": "crypto_hash.md", "type":"quiz", - "mission":"Find the text by cracking the digest of each word.", + "mission":"Find the text by cracking the digest of each word. Make sure the words are entered in the same order, separated by spaces.", "codeBlockIds":[] }, {