-
Notifications
You must be signed in to change notification settings - Fork 9
/
Centaurus_import.html
46 lines (39 loc) · 1.05 KB
/
Centaurus_import.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<html>
<head>
<title>Centaurus Key Importer</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<form>
<div>
<label>Secret key:</label> <input id="seed" type="text">
<input type="button" onclick="generate()" value="Generate QR Code">
</div>
<div id="qrcode"></div>
</form>
<script src="js/aes.js"></script>
<script src="js/stellar-sdk.js"></script>
<script src="js/qrcode.js"></script>
<script>
var generate = function () {
var seed = document.getElementById('seed').value;
var address = StellarSdk.Keypair.fromSeed(seed).address();
var plain = JSON.stringify({
address: address,
seed: seed
});
var pwd = '';
var backupString = CryptoJS.AES.encrypt(plain, pwd);
document.getElementById('qrcode').innerHTML = "";
var qrcode = new QRCode('qrcode', {
text: "centaurus:backup003" + backupString,
width: 256,
height: 256,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.L
});
};
</script>
</body>
</html>