Commit 589b71c7 authored by [1000i100] Millicent Billette's avatar [1000i100] Millicent Billette
Browse files

V1 fonctionnelle

parent acd44f4b
......@@ -42,6 +42,20 @@
a {color: #666; text-decoration-style: dotted; text-decoration-color: #ccc;}
a:hover {color: #666; text-decoration-style: solid; text-decoration-color: #ccc;}
#resultat {
position: fixed;
z-index: 2;
top: 50%;
left: 50%;
width: 1000px;
margin-left: -500px;
height: 200px;
margin-top: -100px;
background-color: #efe;
padding: 20px;
border: 2px groove grey;
}
</style>
</head>
<body>
......@@ -52,18 +66,13 @@
<label for="pubkey">Clef publique : </label><input id="pubkey" type="text" placeholder="Copiez ici la clef publique du compte à récupérer"/>
</fieldset>
<div id="info">
Combinaisons à tester : 9<br/>
Temps estimé : &lt; 1s<br/>
Avancement : 0.000%<br/>
<button>Gsper !</button>
Combinaisons à tester : <span id="combi">9</span><br/>
Temps estimé : <span id="temps">&lt; 1s</span><br/>
Avancement : <span id="percent">0.000%</span><br/>
<button id="compute">Gsper !</button>
</div>
</header>
<div id="resultat" class="pasEncore">
Ǧ'trouvé ! ǦéLéClé !<br/>
Identifiant secret :<br/>
Mot de passe :<br/>
-- Avancé --<br/>
Clef privée :
</div>
<div id="lists">
<fieldset>
......@@ -96,5 +105,7 @@ password
</style>
</a>
</footer>
<script src="https://paperwallet.duniter.io/lib/duniter_tools.js"></script>
<script src="main.js"></script>
</body>
</html>
document.getElementById("compute").addEventListener("click",e=>{
const pub = document.getElementById("pubkey").value.trim();
const pubRaw = Base58.decode(pub);
const idSecList = document.getElementById("salt").value.split("\n").map(str=>str.trim());
const passList = document.getElementById("pass").value.split("\n").map(str=>str.trim());
document.getElementById("combi").innerHTML = idSecList.length*passList.length;
document.getElementById("temps").innerHTML = (idSecList.length*passList.length)+"s";
document.getElementById("percent").innerHTML = "0%";
for(let idSec of idSecList){
for (let pass of passList){
const seed = generate_seed_from_scrypt(idSec,pass)
if(pub === short_publickey_from_seed(seed)){
const resArea = document.getElementById("resultat");
resArea.classList.remove("pasEncore");
resArea.innerHTML = `<h2>Ǧ'trouvé ! ǦéLéClé !</h2><br/>
Identifiant secret : ${idSec}<br/>
Mot de passe : ${pass}<br/>
-- Avancé --<br/>
Clef publique : ${pub}<br/>
Clef privée : ${privatekey_from_seed(seed)}<br/>
Graine : ${Base58.encode(seed)}<br/>
`;
document.getElementById("percent").innerHTML = "Trouvé :)";
return;
}
}
}
document.getElementById("percent").innerHTML = "Fini sans résultats";
});
async function main(){
console.log(short_publickey_from_seed(generate_seed_from_scrypt("a","b")));
}
main();
async function crypt(password, salt){
return new Promise( (resolve ,reject) => {
const options = {
logN: 12,
r: 16,
p: 1,
//dkLen: 32,
encoding: 'binary'
};
scrypt(password, salt, options, (res)=>{
resolve(res);
});
});
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment