diff --git a/src/bitmessagekivy/mpybit.py b/src/bitmessagekivy/mpybit.py index 42b2532e..f74bcf20 100644 --- a/src/bitmessagekivy/mpybit.py +++ b/src/bitmessagekivy/mpybit.py @@ -50,16 +50,14 @@ from kivymd.uix.navigationdrawer import ( NavigationDrawerHeaderBase) from kivymd.uix.selectioncontrol import MDCheckbox from kivymd.theming import ThemeManager + import queues from semaphores import kivyuisignaler + import state from bitmessagekivy.uikivysignaler import UIkivySignaler -# pylint: disable=unused-argument, too-few-public-methods, import-error - from bitmessagekivy import identiconGeneration -import os -from kivy.core.clipboard import Clipboard # pylint: disable=unused-argument, too-few-public-methods @@ -986,7 +984,6 @@ class NavigateApp(App): # pylint: disable=too-many-public-methods def build(self): """Method builds the widget.""" - import os main_widget = Builder.load_file( os.path.join(os.path.dirname(__file__), 'main.kv')) self.nav_drawer = Navigatorss() @@ -1963,4 +1960,4 @@ class Archieve(Screen): class Spam(Screen): """Spam Screen show widgets of page.""" - pass \ No newline at end of file + pass diff --git a/src/highlevelcrypto.py b/src/highlevelcrypto.py index b9088f32..329ad68c 100644 --- a/src/highlevelcrypto.py +++ b/src/highlevelcrypto.py @@ -16,7 +16,9 @@ def makeCryptor(privkey): private_key = a.changebase(privkey, 16, 256, minlen=32) public_key = pointMult(private_key) privkey_bin = '\x02\xca\x00\x20'.encode('raw_unicode_escape') + private_key - pubkey_bin = '\x02\xca\x00\x20'.encode('raw_unicode_escape') + public_key[1:-32] + '\x00\x20'.encode('utf-8') + public_key[-32:] + pubkey_bin = '\x02\xca\x00\x20'.encode( + 'raw_unicode_escape') + public_key[1:-32] + '\x00\x20'.encode( + 'utf-8') + public_key[-32:] cryptor = pyelliptic.ECC(curve='secp256k1', privkey=privkey_bin, pubkey=pubkey_bin) return cryptor diff --git a/src/pyelliptic/arithmetic.py b/src/pyelliptic/arithmetic.py index 2a5d29a9..031db6ae 100644 --- a/src/pyelliptic/arithmetic.py +++ b/src/pyelliptic/arithmetic.py @@ -1,4 +1,4 @@ -0# pylint: disable=missing-docstring,too-many-function-args +# pylint: disable=missing-docstring,too-many-function-args import hashlib import re @@ -30,7 +30,7 @@ def get_code_string(base): elif base == 58: return "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" elif base == 256: - '''raw_unicode_escape is used because in the python3 after range(161) its genreate the' + '''raw_unicode_escape is used because in the python3 after range(161) its genreate the speical character so avoiding that function we have used the raw_unicode method ''' return bytes(range(0, 256)) else: @@ -39,7 +39,7 @@ def get_code_string(base): def encode(val, base, minlen=0): code_string = get_code_string(base) - result = str.encode('') if type(code_string) == bytes else '' + result = str.encode('') if type(code_string) is bytes else '' while val > 0: result = code_string[val % base:val % base + 1] + result val = val // base @@ -47,6 +47,7 @@ def encode(val, base, minlen=0): result = code_string[0] * (minlen - len(result)) + result return result + def decode(string, base): code_string = get_code_string(base) result = 0 diff --git a/src/pyelliptic/openssl.py b/src/pyelliptic/openssl.py index 23de093e..3545fa52 100644 --- a/src/pyelliptic/openssl.py +++ b/src/pyelliptic/openssl.py @@ -679,7 +679,7 @@ def loadOpenSSL(): path.join(sys._MEIPASS, 'libssl.so'), path.join(sys._MEIPASS, 'libcrypto.so.1.1.0'), path.join(sys._MEIPASS, 'libssl.so.1.1.0'), - path.join(sys._MEIPASS, 'libcrypto.so.1.0.2'), + path.join(sys._MEIPASS, 'libcrypto.so.1.0.2'), path.join(sys._MEIPASS, 'libssl.so.1.0.2'), path.join(sys._MEIPASS, 'libcrypto.so.1.0.1'), path.join(sys._MEIPASS, 'libssl.so.1.0.1'), diff --git a/src/shared.py b/src/shared.py index 9ab64f68..09830bde 100644 --- a/src/shared.py +++ b/src/shared.py @@ -89,6 +89,7 @@ def isAddressInMyAddressBookSubscriptionsListOrWhitelist(address): return True return False + def decodeWalletImportFormat(WIFstring): fullString = arithmetic.changebase(WIFstring, 58, 256) privkey = fullString[:-4] @@ -171,8 +172,9 @@ def reloadBroadcastSendersForWhichImWatching(): # we should create Cryptor objects in a dictionary which we will # use to attempt to decrypt encrypted broadcast messages. if addressVersionNumber <= 3: - privEncryptionKey = hashlib.sha512((encodeVarint(addressVersionNumber) \ - + encodeVarint(streamNumber) + hash)).digest()[:32] + privEncryptionKey = hashlib.sha512(( + encodeVarint(addressVersionNumber) + + encodeVarint(streamNumber) + hash)).digest()[:32] MyECSubscriptionCryptorObjects[hash] = \ highlevelcrypto.makeCryptor(hexlify(privEncryptionKey)) else: @@ -191,8 +193,8 @@ def fixPotentiallyInvalidUTF8Data(text): unicode(text, 'utf-8') return text except: - return 'Part of the message is corrupt. The message cannot be' \ - ' displayed the normal way.\n\n' + repr(text) + return 'Part of the message is corrupt. The message cannot be'\ + ' displayed the normal way.\n\n' + repr(text) # Checks sensitive file permissions for inappropriate umask