work on encryption
This commit is contained in:
parent
2071def07b
commit
3a2efce637
@ -249,15 +249,15 @@ class Onionr:
|
|||||||
'''
|
'''
|
||||||
Create a private message and send it
|
Create a private message and send it
|
||||||
'''
|
'''
|
||||||
|
invalidID = True
|
||||||
while True:
|
while invalidID:
|
||||||
try:
|
try:
|
||||||
peer = logger.readline('Peer to send to: ')
|
peer = logger.readline('Peer to send to: ')
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
if self.onionrUtils.validatePubKey(peer):
|
if self.onionrUtils.validatePubKey(peer):
|
||||||
break
|
invalidID = False
|
||||||
else:
|
else:
|
||||||
logger.error('Invalid peer ID')
|
logger.error('Invalid peer ID')
|
||||||
else:
|
else:
|
||||||
|
@ -40,13 +40,13 @@ class OnionrUtils:
|
|||||||
def sendPM(self, pubkey, message):
|
def sendPM(self, pubkey, message):
|
||||||
'''High level function to encrypt a message to a peer and insert it as a block'''
|
'''High level function to encrypt a message to a peer and insert it as a block'''
|
||||||
|
|
||||||
forwardKey = self._core.getPeerInfo(pubkey, 'forwardKey')
|
#forwardKey = self._core.getPeerInfo(pubkey, 'forwardKey')
|
||||||
|
|
||||||
if self._core.getPeerInfo(pubkey, 'pubkeyExchanged') == 1:
|
#if self._core.getPeerInfo(pubkey, 'pubkeyExchanged') == 1:
|
||||||
pass
|
# pass
|
||||||
|
encrypted = self._core._crypto.pubKeyEncrypt(message, pubkey, anonymous=True, encodedData=True)
|
||||||
if len(forwardKey) > 0:
|
logger.info(encrypted)
|
||||||
pass
|
return
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user