logger.info('Generated address with ripe digest: %s'% ripe.digest().encode('hex'))
logger.info('Generated address with ripe digest: %s'%hexlify(ripe.digest()))
try:
logger.info('Address generator calculated %s addresses at %s addresses per second before finding one with the correct ripe-prefix.'%(numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix,numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix/(time.time()-startTime)))
exceptZeroDivisionError:
@ -196,7 +197,7 @@ class addressGenerator(threading.Thread, StoppableThread):
break
logger.info('Generated address with ripe digest: %s'% ripe.digest().encode('hex'))
logger.info('Generated address with ripe digest: %s'%hexlify(ripe.digest()))
try:
logger.info('Address generator calculated %s addresses at %s addresses per second before finding one with the correct ripe-prefix.'%(numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix,numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix/(time.time()-startTime)))
exceptZeroDivisionError:
@ -262,7 +263,7 @@ class addressGenerator(threading.Thread, StoppableThread):
toRipe=key# This is the RIPE hash of the sender's pubkey. We need this below to compare to the RIPE hash of the sender's address to verify that it was encrypted by with their key rather than some other key.
initialDecryptionSuccessful=True
logger.info('EC decryption successful using key associated with ripe hash: %s'%key.encode('hex'))
logger.info('EC decryption successful using key associated with ripe hash: %s'%hexlify(key))
exceptExceptionaserr:
pass
# print 'cryptorObject.decrypt Exception:', err
@ -718,7 +719,7 @@ class objectProcessor(threading.Thread):
privEncryptionKey=doubleHashOfAddressData[:32]# Note that this is the first half of the sha512 hash.
tag=doubleHashOfAddressData[32:]
shared.neededPubkeys[tag]=(toAddress,highlevelcrypto.makeCryptor(privEncryptionKey.encode('hex')))# We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it.
shared.neededPubkeys[tag]=(toAddress,highlevelcrypto.makeCryptor(hexlify(privEncryptionKey)))# We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it.
# Initialize the shared.ackdataForWhichImWatching data structure
queryreturn=sqlQuery(
'''SELECT ackdata FROM sent where (status='msgsent' OR status='doingmsgpow')''')
forrowinqueryreturn:
ackdata,=row
logger.info('Watching for ackdata '+ ackdata.encode('hex'))
logger.info('Watching for ackdata '+hexlify(ackdata))
shared.ackdataForWhichImWatching[ackdata]=0
self.stop.wait(
@ -134,14 +135,14 @@ class singleWorker(threading.Thread, StoppableThread):
logger.error('Error within doPOWForMyV2Pubkey. Could not read the keys from the keys.dat file for a requested address. %s\n'%err)
ifshared.decryptAndCheckPubkeyPayload(value.payload,toaddress)=='successful':#if valid, this function also puts it in the pubkeys table.
@ -675,10 +676,10 @@ class singleWorker(threading.Thread, StoppableThread):
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(ackdata,tr.translateText("MainWindow",'Problem: You are trying to send a message to yourself or a chan but your encryption key could not be found in the keys.dat file. Could not encrypt message. %1').arg(l10n.formatTimestamp()))))
logger.error('Error within sendMsg. Could not read the keys from the keys.dat file for our own address. %s\n'%err)
sqlExecute('''UPDATE sent SET status='badkey' WHERE ackdata=?''',ackdata)
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(ackdata,tr.translateText("MainWindow",'Problem: The recipient\'s encryption key is no good. Could not encrypt message. %1').arg(l10n.formatTimestamp()))))
@ -795,7 +796,7 @@ class singleWorker(threading.Thread, StoppableThread):
else:
# not sending to a chan or one of my addresses
shared.UISignalQueue.put(('updateSentItemStatusByAckdata',(ackdata,tr.translateText("MainWindow","Message sent. Waiting for acknowledgement. Sent on %1").arg(l10n.formatTimestamp()))))
logger.info('Broadcasting inv for my msg(within sendmsg function):'+ inventoryHash.encode('hex'))
logger.info('Broadcasting inv for my msg(within sendmsg function):'+hexlify(inventoryHash))
shared.broadcastToSendDataQueues((
toStreamNumber,'advertiseobject',inventoryHash))
@ -864,7 +865,7 @@ class singleWorker(threading.Thread, StoppableThread):
privEncryptionKey=hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber)+encodeVarint(streamNumber)+ripe).digest()).digest()[:32]# Note that this is the first half of the sha512 hash.
tag=hashlib.sha512(hashlib.sha512(encodeVarint(addressVersionNumber)+encodeVarint(streamNumber)+ripe).digest()).digest()[32:]# Note that this is the second half of the sha512 hash.
iftagnotinshared.neededPubkeys:
shared.neededPubkeys[tag]=(toAddress,highlevelcrypto.makeCryptor(privEncryptionKey.encode('hex')))# We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it.
shared.neededPubkeys[tag]=(toAddress,highlevelcrypto.makeCryptor(hexlify(privEncryptionKey)))# We'll need this for when we receive a pubkey reply: it will be encrypted and we'll need to decrypt it.
ifretryNumber==0:
TTL=2.5*24*60*60# 2.5 days. This was chosen fairly arbitrarily.
@ -878,10 +879,10 @@ class singleWorker(threading.Thread, StoppableThread):
payload+=encodeVarint(streamNumber)
ifaddressVersionNumber<=3:
payload+=ripe
logger.info('making request for pubkey with ripe: %s',ripe.encode('hex'))
logger.info('making request for pubkey with ripe: %s',hexlify(ripe))
else:
payload+=tag
logger.info('making request for v4 pubkey with tag: %s',tag.encode('hex'))
logger.info('making request for v4 pubkey with tag: %s',hexlify(tag))
# print 'trial value', trialValue
statusbar='Doing the computations necessary to request the recipient\'s public key.'
print'Printing everything in subscriptions table:'
@ -50,7 +51,7 @@ def readPubkeys():
output=cur.fetchall()
forrowinoutput:
address,transmitdata,time,usedpersonally=row
print'Address:',address,'\tTime first broadcast:',unicode(strftime('%a, %d%b %Y %I:%M %p',localtime(time)),'utf-8'),'\tUsed by me personally:',usedpersonally,'\tFull pubkey message:', transmitdata.encode('hex')
print'Address:',address,'\tTime first broadcast:',unicode(strftime('%a, %d%b %Y %I:%M %p',localtime(time)),'utf-8'),'\tUsed by me personally:',usedpersonally,'\tFull pubkey message:',hexlify(transmitdata)