-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInfo.txt
63 lines (46 loc) · 2.97 KB
/
Info.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
Perl Scripts For Private Key/Public Key/Hex Key Conversions & BIP38 Encryption For BTC/LTC/ETH
----------------------------------------------------------------------------------------------
A collection of Perl scripts for the command line based on the CryptX CPAN module.
Can process individual keys or files of keys in bulk. They work with the standard old style keys.
May be useful as a second method for cross-checking purposes on a cold storage system when generating new keys
and BIP38 encrypting/decrypting keys.
Can assist with generating LTC/ETH private keys from BTC private keys, since LTC/ETH use same secp256k1 ECC as BTC so that
private keys for all three are simply numbers in the range [1, n - 1] where :
n = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141
is the parameter specified in secp256k1 (ref: https://www.secg.org/sec2-v2.pdf and https://www.secg.org/sec1-v2.pdf)
May be easily adaptable to other cryptos which also use secp256k1.
Generate ETH keys :
perl btc-privkeytohex.pl -f btc-privkeys.txt > eth-privkeys.txt
perl eth-privkeytoaddr.pl -f eth-privkeys.txt > eth-addresses.txt
Generare LTC keys :
perl btc-privkeytohex.pl -f btc-privkeys.txt > hex-keys.txt
perl ltc-hextoprivkey.pl -f hex-keys.txt > ltc-privkeys.txt
perl ltc-privkeytoaddr.pl -f ltc-privkeys.txt > ltc-addresses.txt
Can perform bulk BIP38 encryption/decryption :
perl bip38convert.pl -f <filename1> <filename2> ... > output.txt
or single BIP38 encryption/decryption :
perl bip38convert.pl <priv_key> <password>
perl bip38convert.pl <enc_priv_key> <password>
Can use to BIP38 encrypt LTC/ETH private keys by converting them to hex keys first, then interpreting that as a BTC private key, then apply BIP38. Then reverse the procedure to decrypt.
ETH BIP38 encrypt :
perl btc-hextoprivkey.pl -f eth-privkeys.txt > btc-privkeys.txt
.... edit btc-privkeys.txt to append password on first line ....
perl bip38convert.pl -f btc-privkeys.txt > eth-encprivkeys.txt
ETH BIP38 decrypt :
.... edit eth-encprivkeys.txt to append password on first line ....
perl bip38convert.pl -f eth-encprivkeys.txt > btc-privkeys.txt
perl btc-privkeytohex.pl -f btc-privkeys.txt > eth-privkeys.txt
LTC BIP38 encrypt :
perl ltc-privkeytohex.pl -f ltc-privkeys.txt > hex-keys.txt
perl btc-hextoprivkey.pl -f hex-keys.txt > btc-privkeys.txt
.... edit btc-privkeys.txt to append password on first line ....
perl bip38convert.pl -f btc-privkeys.txt > ltc-encprivkeys.txt
LTC BIP38 decrypt :
.... edit ltc-encprivkeys.txt to append password on first line ....
perl bip38convert.pl -f ltc-encprivkeys.txt > btc-privkeys.txt
perl btc-privkeytohex.pl -f btc-privkeys.txt > hex-keys.txt
perl ltc-hextoprivkey.pl -f hex-keys.txt > ltc-privkeys.txt
No warranty or claim of fitness for any purpose is provided, I have just found these useful in my own work,
and have always used them only as a second cross-checking method for anything of value. They have always
correlated with the results of bitaddress.org and liteaddress.org.
Tested on Perl v5.12.3.