Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "crypto-examples",
"version": "1.0.0",
"description": "7 useful examples of the node crypto module.",
"main": "index.js",
"dependencies": {
"reverse-md5": "0.0.5"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fireship-io/node-crypto-examples.git"
},
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/fireship-io/node-crypto-examples/issues"
},
"homepage": "https://github.com/fireship-io/node-crypto-examples#readme"
}
21 changes: 20 additions & 1 deletion src/hack.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,30 @@

const hash = '5e7d28e2cfff93edefb2d15abad07ec5';

const { assert } = require('console');
var ReverseMd5 = require('reverse-md5')

function hacker(hash) {

const rev = ReverseMd5({
lettersUpper: true,
lettersLower: true,
numbers: true,
special: true,
whitespace: true,
maxLen: 15
})
console.log('Here')
const obj = rev(hash);
return obj.str;
}


// When you figure it out, create a Pull Request on github with value.
// First correct PR wins a Lifetime PRO membership and T-shirt

///// ANSWER /////

const hacked = 'superhacker';

assert(hacker(hash) === hacked, 'You did not hack the hash!');