-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.py
More file actions
26 lines (20 loc) · 815 Bytes
/
example.py
File metadata and controls
26 lines (20 loc) · 815 Bytes
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
#Example script using steg.py which inserts a private key into a supplied image and outputs output.png containing the key
__author__ = 'pete'
from steg import *
print 'Bitcoin steganography tool..example'
print '>>>Usage: type or paste the path and filename of an image file to be used: '
img_file = raw_input()
if not img_file:
print 'this only works with a provided image file - sorry'
exit()
st = Steg() #instantiate the steg class
print '>>>Usage: now type or paste a private key to encode into the image (hit enter for a random key to be generated):'
priv = raw_input()
if not priv:
priv = random_key()
print 'hex', priv
priv = create_wif_key(priv)
print ' input', priv
st.encode(img_file, priv) #encode key
data = st.decode('output.png') #decode key
print 'output', data