Git Product home page Git Product logo

maml's People

Contributors

codacy-badger avatar stkubr avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

maml's Issues

python-ed25519 MemoryError

I have ran this code:

prikey, pubkey = Ed25519Cipher.generate_keys()

Generated this error:

  File "C:\<>\Python\Python36\lib\site-packages\ed25519\keys.py", line 85, in __init__
    vk_s, sk_s = _ed25519.publickey(sk_s)

MemoryError

Apparently, this is a common issue for ed25519. Also I am using Python 3.6.7.

is_trusted returns false for trusted key

When generating the keys and adding them to the channel as trusted_pubkey. The read() function of the given channel returns a json with "is_trusted: false".

Code to reproduce:

import random
import string
from iota import Address
from ciphers import Ed25519Cipher
from mam_lite import MAML_Ed25519

addr_test = Address('WAUCWAQCRCTCAB9BCBWACBCBRCCB9BUCWARCPCXARCWABBYACBTCWAUATCCBYAWAUCCBPCYAPCQC9BBBC')
mam_stream_1 = MAML_Ed25519(root_address=addr_test, channel_password='test_pass')

# generate pubkey and make it trusted
prikey, pubkey = Ed25519Cipher.generate_keys()
mam_stream_1.add_trusted_pubkey('test_entity', pubkey)

# write with first MAML stream
write_res = mam_stream_1.write('data_to_be_sent', pubkey, prikey)

# read and validate with another
read_res = mam_stream_1.read()
print(read_res)
print()
print(read_res.is_trusted)

example.py uses old class name

This raises no module named MAML_Ed25519


from mam_lite import MAML_Ed25519

addr_test = Address(''.join(random.choices(string.ascii_uppercase + '9', k=81)))
mam_stream_1 = MAML_Ed25519(root_address=addr_test, channel_password='test_pass')
mam_stream_2 = MAML_Ed25519(root_address=addr_test, channel_password='test_pass')

Fixed by changing to new class name:

from mam_lite import MaskedAuthMsgStream

addr_test = Address(''.join(random.choices(string.ascii_uppercase + '9', k=81)))
mam_stream_1 = MaskedAuthMsgStream(root_address=addr_test, write_pwd='test_pass')
mam_stream_2 = MaskedAuthMsgStream(root_address=addr_test, write_pwd='test_pass')

ModuleNotFoundError: No module named 'Crypto'

This is despite I have did: pip install Crypto.

I have double checked my site packages to ensure that it is there.

I also tried the following suggestion to change the site-package folder name from crypto to Crypto:https://stackoverflow.com/questions/19623267/importerror-no-module-named-crypto-cipher

But it then does not recognize import Random.

Do we have to import pycrypto instead?

EDIT: I think I solved but needs further test. Since I am using Python 3.6.7, I need to install pycryptodome rather than pycrypto or Crypto.

https://stackoverflow.com/questions/41813030/problems-with-installation-pycrypto-in-python-3-6

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.