Skip to content

Commit

Permalink
feat: add iterations feature
Browse files Browse the repository at this point in the history
  • Loading branch information
damartripamungkas committed Dec 4, 2023
0 parents commit abc8933
Show file tree
Hide file tree
Showing 14 changed files with 280 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"overrides": [
{
"files": "*.json",
"options": {
"tabWidth": 2
}
},
{
"files": "*.html",
"options": {
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"semi": true
}
}
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 damartripamungkas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
47 changes: 47 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<h1 align="center">
CUSTOM-KEY-WALLET-CRYPTO
</h1>

<p align="center">
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/damartripamungkas/custom-key-wallet-crypto?color=04D361&labelColor=000000">

<a href="#">
<img alt="Made by" src="https://img.shields.io/static/v1?label=made%20by&message=damartripamungkas&color=04D361&labelColor=000000">
</a>

<img alt="Repository size" src="https://img.shields.io/github/repo-size/damartripamungkas/custom-key-wallet-crypto?color=04D361&labelColor=000000">

<a href="#">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/damartripamungkas/custom-key-wallet-crypto?color=04D361&labelColor=000000">
</a>
</p>

<br>

![Home](/screenshot/home.png)

### 📖 Description :

This website assists users who struggle recalling the lengthy mnemonic phrases or private keys for their cryptocurrency wallets. To address this issue, the site provides a method for users to generate customized mnemonic passphrase words. These customized word combinations serve as an easier alternative for users to remember. `Please refrain from using short or easily guessable words when creating your custom passphrases. For better security, construct elaborate multi-word phrases appended with random number sequences.`

### 🪂 Features :

- keccak256 hashing algorithm
- support iterations, Iteration refers to applying the hash function double based on the provided number. For instance, if the number given is 2, the process would be as follows: `hash(hash("your words"))` In other words, your words are hashed once, then the output is hashed again. So a higher count leads to greater computation worked into hashing the data.

### 👮 Security :

This website does not store any user input, wallet addresses, private keys or other user data. You may review the source code to confirm that no data is saved. Additionally, turning off mobile data or internet connection when accessing the website to prove it.

### ⛷️ Support Wallet :

- Wallet evm like ethereum, bsc, arbitrum or other
- Wallet bitcoin (coming soon)

### 🥤 Donation For Support Me :

- (bsc, eth, other) = 0x106afd8f747687876fa9b096ff20a78620621af3

### 📝 License :

Licensed under the [MIT License](./LICENSE).
135 changes: 135 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="damartripamungkas" />
<meta
name="description"
content="A cryptocurrency wallet with customized private keys generated from words"
/>
<title>Custom Key Wallet Crypto</title>
<link rel="apple-touch-icon" sizes="180x180" href="./public/favicon/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="./public/favicon/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="./public/favicon/favicon-16x16.png" />
<link rel="manifest" href="./public/favicon/site.webmanifest" />
<link rel="stylesheet" href="./public/css/style.css" />
</head>
<body>
<center>
<div class="container">
<div class="card">
<h1 class="mt-0">Custom Key Wallet Crypto</h1>
<p>author: damartripamungkas</p>
<p>donation address: 0x106afd8f747687876fa9b096ff20a78620621af3</p>
<a href="https://github.com/damartripamungkas/custom-key-wallet-crypto"
>https://github.com/damartripamungkas/custom-key-wallet-crypto</a
>
</div>

<div class="card">
<p class="mt-0">Select type wallet</p>
<select id="select-type-wallet" aria-label="select-type-wallet">
<option value="evm" selected>ethereum (EVM)</option>
</select>

<p class="pt-10">Number of iterations</p>
<input
id="input-number-iterations"
type="number"
value="1"
aria-label="input-number-iterations"
/>

<p class="pt-10">Enter the words you want to use</p>
<textarea
class="text-area"
id="input-words-wallet"
aria-label="input-words-wallet"
></textarea>

<p class="pt-10">Result privatekey and address wallet</p>
<textarea
class="w-full click-able"
id="result-private-key-wallet"
placeholder="privatekey wallet ..."
aria-label="result-private-key-wallet"
disabled
></textarea>
<textarea
class="mt-2-5 w-full click-able"
id="result-address-wallet"
placeholder="address wallet ..."
aria-label="result-address-wallet"
disabled
></textarea>
</div>
</div>
</center>

<script type="module">
import { ethers } from "./public/js/ethers.min.js";

const createWallet = {
evm: (str, iterations) => {
const utfBytes = ethers.toUtf8Bytes(str);
let pk = ethers.keccak256(utfBytes);

for (let index = 1; index < iterations; index++) {
pk = ethers.keccak256(pk);
}

const { address } = new ethers.Wallet(pk);
return { pk, address: address.toLowerCase() };
},
};

const state = {
selectTypeWallet: "",
inputNumberIterations: "",
};

const selectTypeWallet = document.getElementById("select-type-wallet");
const inputNumberIterations = document.getElementById("input-number-iterations");
const inputWordsWallet = document.getElementById("input-words-wallet");
const resultPrivateKeyWallet = document.getElementById("result-private-key-wallet");
const resultAddressWallet = document.getElementById("result-address-wallet");
const hashNow = () => {
const value = inputWordsWallet.value;
if (value.length == 0) {
resultPrivateKeyWallet.textContent = "";
resultAddressWallet.textContent = "";
return;
}

let numberIterations = state.inputNumberIterations;
if (numberIterations.length == 0 || parseInt(numberIterations) <= 0) {
numberIterations = 1;
}

const { pk, address } = createWallet[selectTypeWallet.value](value, numberIterations);
resultPrivateKeyWallet.textContent = pk;
resultAddressWallet.textContent = address;
};

selectTypeWallet.onchange = () => {
state.selectTypeWallet = selectTypeWallet.value;
};

inputNumberIterations.oninput = () => {
if (inputNumberIterations.value.length <= 0) {
resultPrivateKeyWallet.textContent = "";
resultAddressWallet.textContent = "";
return;
}

if (inputNumberIterations.value > 10) inputNumberIterations.value = 10;
if (inputNumberIterations.value <= 0) inputNumberIterations.value = 1;
state.inputNumberIterations = inputNumberIterations.value;
hashNow();
};

inputWordsWallet.oninput = hashNow;
</script>
</body>
</html>
56 changes: 56 additions & 0 deletions public/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
body {
font-family: Arial, Helvetica, sans-serif;
background-color: #f2f2f2;
}

.text-area {
width: 100%;
min-height: 3rem;
border: 1px solid #ccc;
font-size: large;
font-family: monospace;
}

@media screen and (max-width: 576px) {
a {
font-size: small;
}

p {
font-size: small;
}
}

.container {
max-width: 64rem;
margin: 0 auto;
}

.card {
border: 1px solid #ccc;
padding: 30px;
margin-bottom: 15px;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
background-color: #fff;
border-radius: 0.5rem;
}

.pt-10 {
padding-top: 2.5rem;
}

.w-full {
width: 100%;
}

.mt-2-5 {
margin-top: 0.625rem;
}

.mt-0 {
margin-top: 0;
}

.click-able {
cursor: pointer;
}
Binary file added public/favicon/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/favicon/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
1 change: 1 addition & 0 deletions public/js/ethers.min.js

Large diffs are not rendered by default.

Binary file added screenshot/home.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit abc8933

Please sign in to comment.