Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Simeonov committed Nov 26, 2021
0 parents commit 4e571af
Show file tree
Hide file tree
Showing 112 changed files with 9,939 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.npm
node_modules
dist/*
!dist/.gitkeep
108 changes: 108 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
![CryptoAPIs](./src/resources/images/logo.svg?raw=true)

# CryptoAPIs Wallet Recovery tool

#### Tool for recovering private key from wallet recovery data

***

## Table of Contents

- [Installing](#installing)
- [Usage](#usage)
- [Building executable files](#building-executable-files)
- [With docker](#with-docker)
- [Without docker](#without-docker)
- [Packages](#packages)
- [Screenshots](#screenshots)
- [License](#license)

## Installing

You need to have `npm` package manager installed.

To install and start the app you need to run these two commands.

```bash
npm i -D
npm run start
```

## Usage

This Open Source Tool will help you back up and then recover your Crypto APIs Wallet in case of an emergency. It should be used together with the WaaS Backup and Recover feature in your Crypto APIs 2.0 Dashboard [here](https://my.cryptoapis.io/wallets).
To backup your Wallet simply follow the steps bellow:

1. Open our Open Source Recovery Tool.
2. You would need to first generate a RSA key pair of public and private keys. For this purpose you require a password. It can be of your choosing, or you can generate a random and complex password by navigating to the “Generate Random Password” menu section.
3. Use the selected password in the "Generate RSA key pairs" menu section. The result will be one public key and one private key. Keep that password safe as it will be needed to recover your Wallet.
4. Navigate to your Crypto APIs 2.0 Dashboard [here](https://my.cryptoapis.io/wallets). If you don’t have a Wallet yet, you can create one. If you have already created your Wallet, then click on the “Back up Wallet” button. Use the public key you’ve just generated in our Open Source Recovery Tool in the two fields for the RSA key.
5. The private key needs to be stored in a safe location, as it will be required for the recovery process of your Wallet!
6. In the Crypto APIs 2.0 Dashboard complete the backup of your Wallet. The PDF file downloaded will have more information on the Recovery process.

## Building executable files

### With docker

You need to have `docker` installed on your machine.

Building executable files can be done with this command (script):

```bash
./bin/build.sh
```

Choose the OS you want to have an executable for by giving the script a parameter with the name of the OS.

```bash
./bin/build.sh linux
./bin/build.sh windows
./bin/build.sh mac
```

> **_NOTE:_** Building executable files for macOS can be done only if the machine you are executing the script from is on macOS.
### Without docker

Using the following command will build the files for the OS you are executing it from

```bash
npm run build
```

If you want to build files for a specific OS you can use either of these scripts

```bash
npm run dist:linux
npm run dist:windows
npm run dist:mac
```

> **_NOTE:_** Building executable files without docker requires for the machine to be on the same OS or to have the necessary packages installed.
### Packages

Packages are located in `dist` folder

The file types that you get are as follows:
- For `linux` you will get `.AppImage` file
- For `windows` you will get `.exe` file
- For `macOS` you will get `.dmg` file

## Screenshots

#### *Homepage*
![Homepage](./screenshots/screenshot-recovery-tool-home.png?raw=true)

#### *Generate password*
![Generate password](./screenshots/screenshot-recovery-tool-generate-random-password.png?raw=true)

#### *Generate rsa key*
![Generate rsa key](./screenshots/screenshot-recovery-tool-rsa-private-key.png?raw=true)

#### *Recover xPriv*
![Recover xPriv](./screenshots/screenshot-recovery-tool-recover-xpriv.png?raw=true)

## License

MIT
43 changes: 43 additions & 0 deletions bin/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
os=("linux" "mac" "windows")
if ! [[ ${os[*]} =~ $(echo "\<${1}\>") ]]
then
echo "Usage bin/build.sh [operating system] (linux, mac or windows)"
exit 1
fi

if [[ "$1" == "mac" ]] && [[ "$OSTYPE" != "darwin"* ]];
then
echo "Cannot build mac files when not on a macOS system!"
exit 1
fi

RED='\033[0;31m'
NC='\033[0m'
IMAGE=""

case $1 in
linux)
IMAGE="electronuserland/builder"
;;
windows)
IMAGE="electronuserland/builder:wine"
;;
mac)
IMAGE="electronuserland/builder"
;;
esac

docker run --rm -ti \
--env-file <(env | grep -iE 'DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS_TAG|TRAVIS|TRAVIS_REPO_|TRAVIS_BUILD_|TRAVIS_BRANCH|TRAVIS_PULL_REQUEST_|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_') \
--env ELECTRON_CACHE="/root/.cache/electron" \
--env ELECTRON_BUILDER_CACHE="/root/.cache/electron-builder" \
-v ${PWD}/src:/project/src \
-v ${PWD}/dist:/project/dist \
-v ${PWD}/node_modules:/project/node_modules \
-v ${PWD}/package.json:/project/package.json \
-v ${PWD}/package-lock.json:/project/package-lock.json \
-v ~/.cache/electron:/root/.cache/electron \
-v ~/.cache/electron-builder:/root/.cache/electron-builder \
"$IMAGE" \
/bin/bash -c "npm run dist:$1 && echo \"Finished building package for $1 and created new executable file in directory /dist.\""

Empty file added dist/.gitkeep
Empty file.
15 changes: 15 additions & 0 deletions examples/data/private_key.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
-----BEGIN RSA PRIVATE KEY-----
MIICXgIBAAKBgQCrddGqVDQ3YjI9bUFhGgjGdd2BP3lNdcqJo+1icCNcwBvR4fjP
3qxmwG4bkuwpG+fTO66W4wo0KIamliVFpOcijpG9XDV46k8NGX3j/VWdyBmJ8+IT
ot5oshw5E+p3a2OpUUQGU0ZDbiT9RiHHkMf0HDAS8c/TYnvcXH2ZLSThvwIDAQAB
AoGBAIzPn7bgnFl3nYbw+SaDuP0zwwvoUviYahOLuuKC8ae0ZaSCjlI4ryFbm5Gt
oaFJN6Q0eXeVUcXwGlUpLcb6XI6du43/wKtTv8NHpF156mQpv8YUSpc6DFBKicYC
4Efcqxg+gAltbF6PYuKikBKKDITC7s+JIss9kCuCYl/wuULRAkEA4U4gK/RfpLBx
ubK7gZmwnDOqB4A826zMDGmstiy7KUNc7+Z/gF2oVbUI1cSRBe1inDTvy7SxIBam
Gw4tn/1SSwJBAMLRxAERQ1Xyqr/xCG7pUkOExLnReXRA6CzWJvmqKfmRM6/avCfI
eycKy5MLaCuYwTMtJ1DTmuFlT7zktj2wJd0CQQC1kM4gXekNwRuE+OJeiMpotsHZ
FaD1rwUpI6gJj3asxBqLQgeSHOfhWejqzGPKkQkctRRh5xWutFHcD8r42Z6NAkEA
hJJkE+ngbXtN0IHAIGFr1oBhsqUmRgLpO6GbMigmmirCBngNs/DMRTwmXfDUOV6g
kie26lykt57OjRcCIKZejQJAXg/SYkzAAGLK4+BJCbthNNCV3Mi4Z+ZxLyKd6+ok
BFlQ/bvtVW/8uHFa0e2WToYQABR7HyGq6my+OgmD1g5rKg==
-----END RSA PRIVATE KEY-----
5 changes: 5 additions & 0 deletions examples/data/public_key.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBAKt10apUNDdiMj1tQWEaCMZ13YE/eU11yomj7WJwI1zAG9Hh+M/erGbA
bhuS7Ckb59M7rpbjCjQohqaWJUWk5yKOkb1cNXjqTw0ZfeP9VZ3IGYnz4hOi3miy
HDkT6ndrY6lRRAZTRkNuJP1GIceQx/QcMBLxz9Nie9xcfZktJOG/AgMBAAE=
-----END RSA PUBLIC KEY-----
Loading

0 comments on commit 4e571af

Please sign in to comment.