-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.py
More file actions
47 lines (44 loc) · 1.86 KB
/
Copy pathmain.py
File metadata and controls
47 lines (44 loc) · 1.86 KB
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
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project :mint-tool-master
@File :main.py
@Author :Richard
@License :(C) Copyright 2021-2022, Richard.
@Date :2023/11/18 22:31
@contact :richard.eth@foxmail.com
'''
from common import wallet, pbeWithMd5Des
from mint import mintEvm20
import getpass
def main():
print("操作说明:\n1.创建钱包\n2.加密私钥/助记词\n3.解密私钥/助记词\n4.Mint EVM铭文\n输入'h'或者'帮助'查看菜单详情")
while True:
action = input("请输入你的操作:")
try:
if action == 'h' or action == '帮助':
print(
"操作说明:\n1.创建钱包\n2.加密私钥/助记词\n3.解密私钥/助记词\n4.Mint EVM铭文\n输入'h'或者'帮助'查看菜单详情")
elif int(action) == 1:
wallet.create_pwd_wallet()
elif int(action) == 2:
password = getpass.getpass("输入密码:")
plaintext = input("输入私钥/助记词:")
# Encrypt
encrypted_text = pbeWithMd5Des.encrypt_pbe_with_md5_and_des(password, plaintext)
print(f"加密后私钥/助记词:{encrypted_text}")
elif int(action) == 3:
password = getpass.getpass("输入密码:")
plaintext = input("输入私钥/助记词:")
#Decrypt
decrypted_text = pbeWithMd5Des.decrypt_pbe_with_md5_and_des(password, plaintext)
print(f"解密后私钥/助记词:{decrypted_text}",)
elif int(action) == 4:
pwd = getpass.getpass("请输入你的密码:")
mintEvm20.mint(pwd)
else:
print("请输入正确的指令!")
except Exception as e:
print(f'Main ERROR:{e}')
if __name__ == '__main__':
main()