# Maintainer: Bob Mottram (4096 bits) <bob@robotics.uk.to>
pkgname=pybitmessage
pkgver=0.3.5
pkgver=0.4.0
pkgrel=1
pkgdesc="Bitmessage is a P2P communications protocol used to send encrypted messages to another person or to many subscribers. It is decentralized and trustless, meaning that you need-not inherently trust any entities like root certificate authorities. It uses strong authentication which means that the sender of a message cannot be spoofed, and it aims to hide "non-content" data, like the sender and receiver of messages, from passive eavesdroppers like those running warrantless wiretapping programs."
print'Let us make an address from scratch. Suppose we generate two random 32 byte values and call the first one the signing key and the second one the encryption key:'
#print 'Uncomment this next line to print the first deterministic address that would be generated with the given passphrase. This will Not add it to the Bitmessage interface or the keys.dat file.'
QMessageBox.about(self,_translate("MainWindow","Address version number"),_translate(
"MainWindow","Concerning the address %1, Bitmessage cannot understand address version numbers of %2. Perhaps upgrade Bitmessage to the latest version.").arg(toAddress).arg(str(addressVersionNumber)))
continue
@ -2200,9 +2207,9 @@ class MyForm(QtGui.QMainWindow):
else:
# User selected 'Use the same stream as an existing
# Form implementation generated from reading ui file 'newaddressdialog.ui'
#
# Created: Thu Jun 13 20:12:21 2013
# by: PyQt4 UI code generator 4.10.1
# Created: Sun Sep 15 23:53:31 2013
# by: PyQt4 UI code generator 4.10.2
#
# WARNING! All changes made in this file will be lost!
@ -178,7 +178,7 @@ class Ui_NewAddressDialog(object):
self.radioButtonDeterministicAddress.setText(_translate("NewAddressDialog","Use a passphrase to make addresses",None))
self.checkBoxEighteenByteRipe.setText(_translate("NewAddressDialog","Spend several minutes of extra computing time to make the address(es) 1 or 2 characters shorter",None))
self.label_11.setText(QtGui.QApplication.translate("regenerateAddressesDialog","Number of addresses to make based on your passphrase:",None,QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("regenerateAddressesDialog","Address version Number:",None,QtGui.QApplication.UnicodeUTF8))
self.checkBoxEighteenByteRipe.setText(QtGui.QApplication.translate("regenerateAddressesDialog","Spend several minutes of extra computing time to make the address(es) 1 or 2 characters shorter",None,QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("regenerateAddressesDialog","You must check (or not check) this box just like you did (or didn\'t) when you made your addresses the first time.",None,QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("regenerateAddressesDialog","If you have previously made deterministic addresses but lost them due to an accident (like hard drive failure), you can regenerate them here. If you used the random number generator to make your addresses then this form will be of no use to you.",None,QtGui.QApplication.UnicodeUTF8))
self.checkBoxEighteenByteRipe.setText(_translate("regenerateAddressesDialog","Spend several minutes of extra computing time to make the address(es) 1 or 2 characters shorter",None))
self.label_4.setText(_translate("regenerateAddressesDialog","You must check (or not check) this box just like you did (or didn\'t) when you made your addresses the first time.",None))
self.label.setText(_translate("regenerateAddressesDialog","If you have previously made deterministic addresses but lost them due to an accident (like hard drive failure), you can regenerate them here. If you used the random number generator to make your addresses then this form will be of no use to you.",None))
numberOfNullBytesDemandedOnFrontOfRipeHash=1# the default
else:
sys.stderr.write(
'Programming error: A structure with the wrong number of values was passed into the addressGeneratorQueue. Here is the queueValue: %s\n'%repr(queueValue))
ifaddressVersionNumber<3oraddressVersionNumber>3:
ifaddressVersionNumber<3oraddressVersionNumber>4:
sys.stderr.write(
'Program error: For some reason the address generator queue has been given a request to create at least one version %s address which it cannot do.\n'%addressVersionNumber)
ifnonceTrialsPerByte==0:
@ -51,26 +69,121 @@ class addressGenerator(threading.Thread):
print'Generated address with ripe digest:',ripe.digest().encode('hex')
print'Address generator calculated',numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix,'addresses at',numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix/(time.time()-startTime),'addresses per second before finding one with the correct ripe-prefix.'
@ -78,193 +191,97 @@ class addressGenerator(threading.Thread):
ripe.update(sha.digest())
# print 'potential ripe.digest',
# ripe.digest().encode('hex')
ifeighteenByteRipe:
ifripe.digest()[:2]=='\x00\x00':
break
else:
ifripe.digest()[:1]=='\x00':
break
print'Generated address with ripe digest:',ripe.digest().encode('hex')
print'Address generator calculated',numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix,'addresses at',numberOfAddressesWeHadToMakeBeforeWeFoundOneWithTheCorrectRipePrefix/(time.time()-startTime),'addresses per second before finding one with the correct ripe-prefix.'
print'Cannot decode incoming broadcast versions higher than 2. Assuming the sender isn\'t being silly, you should upgrade Bitmessage because this message shall be ignored.'
ifbroadcastVersion<1orbroadcastVersion>3:
print'Cannot decode incoming broadcast versions higher than 3. Assuming the sender isn\'t being silly, you should upgrade Bitmessage because this message shall be ignored.'
return
ifbroadcastVersion==1:
beginningOfPubkeyPosition=readPosition# used when we add the pubkey to our pubkey table
@ -502,6 +502,10 @@ class receiveDataThread(threading.Thread):
print'Cannot decode senderAddressVersion less than 4 for broadcast version number 3. Assuming the sender isn\'t being silly, you should upgrade Bitmessage because this message shall be ignored.'
return
readPosition+=sendersAddressVersionLength
sendersStream,sendersStreamLength=decodeVarint(
decryptedData[readPosition:readPosition+9])
ifsendersStream!=cleartextStreamNumber:
print'The stream number outside of the encryption on which the POW was completed doesn\'t match the stream number inside the encryption. Ignoring broadcast.'