Omnibus commited on
Commit
c7772d7
·
1 Parent(s): 2358d55

Update crypt.py

Browse files
Files changed (1) hide show
  1. crypt.py +18 -0
crypt.py CHANGED
@@ -14,6 +14,24 @@ import qrcode as qr
14
  import math
15
  from PIL import ImageFont, ImageDraw, Image
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  def process(img,font_text,font_fac,font_x,font_y,font_col,font_op):
18
  img.save('tmp.png')
19
 
 
14
  import math
15
  from PIL import ImageFont, ImageDraw, Image
16
 
17
+ def address(im):
18
+
19
+ secret_code="SECRET PASSWORD"
20
+ priv_key = crypt.decode(im)
21
+ print(f'priv_key:: {priv_key}')
22
+ key = RSA.import_key(priv_key,passphrase=secret_code)
23
+
24
+ public_key = key.publickey().export_key('PEM')
25
+ file_out_pub = open("receiver.pem", "wb")
26
+ file_out_pub.write(public_key)
27
+ file_out_pub.close()
28
+
29
+
30
+ hash_1 = calculate_hash(public_key, hash_function="sha256")
31
+ hash_2 = calculate_hash(hash_1, hash_function="ripemd160")
32
+ address = base58.b58encode(hash_2)
33
+ print (address)
34
+
35
  def process(img,font_text,font_fac,font_x,font_y,font_col,font_op):
36
  img.save('tmp.png')
37