|
|
@ -95,6 +95,8 @@ register_command('signmessage', 2,-1, False, True, True, 'Sign a mess |
|
|
|
register_command('unfreeze', 1, 1, False, True, False, 'Unfreeze the funds at one of your wallet\'s address', 'unfreeze <address>') |
|
|
|
register_command('validateaddress', 1, 1, False, False, False, 'Check that the address is valid', 'validateaddress <address>') |
|
|
|
register_command('verifymessage', 3,-1, False, False, False, 'Verifies a signature', verifymessage_syntax) |
|
|
|
register_command('encrypt', 2,-1, False, False, False, 'encrypt a message with pubkey') |
|
|
|
register_command('decrypt', 2,-1, False, False, False, 'decrypt a message with privkey') |
|
|
|
|
|
|
|
register_command('daemon', 1, 1, True, False, False, 'start/stop daemon') |
|
|
|
register_command('getproof', 1, 1, True, False, False, 'start/stop daemon') |
|
|
@ -390,5 +392,13 @@ class Commands: |
|
|
|
else: |
|
|
|
return "unknown transaction" |
|
|
|
|
|
|
|
def encrypt(self, pubkey, message): |
|
|
|
return EC_KEY.encrypt_message(message, pubkey.decode('hex')) |
|
|
|
|
|
|
|
def decrypt(self, private_key, message): |
|
|
|
eck = EC_KEY(private_key.decode('hex')) |
|
|
|
decrypted = eck.decrypt_message(message) |
|
|
|
return decrypted[0] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|