Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot import name 'ChaCha20_Poly1305' from 'Crypto.Cipher' #93

Open
chetbox opened this issue Jul 1, 2024 · 2 comments
Open

cannot import name 'ChaCha20_Poly1305' from 'Crypto.Cipher' #93

chetbox opened this issue Jul 1, 2024 · 2 comments

Comments

@chetbox
Copy link

chetbox commented Jul 1, 2024

The problem

I cloned the repo on a Raspberry Pi 4 and followed the instructions to build with Docker but I am unable to run the built image.

git clone https://github.com/openairplay/airplay2-receiver.git
cd airplay2-receiver
docker build -f docker/Dockerfile -t ap2-receiver .

I'm using a CM4 with builtin eMMC.

What commit exhibits the issue?

6c343d3

Was there a last known working commit?

No response

What type of installation are you running?

Docker

With which python3 version do you run Receiver?

3.7.3

OS the receiver runs on

Raspberry Pi OS (bookworm, 64-bit)

OS the sender runs

Which sender client was used

No response

Command invocation

docker run -it --rm --device /dev/snd --net host --volume pwd/pairings/:/airplay2/pairings/ --env AP2IFACE=eth0 ap2-receiver

Please include --debug output which helps to illustrate the problem

$ docker run -it --rm --device /dev/snd --net host --volume `pwd`/pairings/:/airplay2/pairings/ --env AP2IFACE=eth0  ap2-receiver 
[ ok ] Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon.
Traceback (most recent call last):
  File "ap2-receiver.py", line 23, in <module>
    from ap2.pairing.hap import Hap, HAPSocket, LTPK, DeviceProperties
  File "/airplay2/ap2/pairing/hap.py", line 15, in <module>
    from Crypto.Cipher import ChaCha20_Poly1305  # PyCryptodome
ImportError: cannot import name 'ChaCha20_Poly1305' from 'Crypto.Cipher' (/usr/lib/python3/dist-packages/Crypto/Cipher/__init__.py)

Additional information

$ docker run -it --rm ap2-receiver /usr/bin/env python3
Python 3.7.3 (default, Mar 23 2024, 16:12:05) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import Crypto.Cipher
>>> Crypto.Cipher.__all__
['AES', 'ARC2', 'ARC4', 'Blowfish', 'CAST', 'DES', 'DES3', 'XOR', 'PKCS1_v1_5', 'PKCS1_OAEP']
>>>
@systemcrash
Copy link
Member

At a guess, it looks like the available Crypto Cipher libs don't have ChaCha. Is a newer Python available? These wheels must be compilable on the target platform in order to support the suites necessary.

You would do well to ask at https://github.com/Legrandin/pycryptodome

@systemcrash
Copy link
Member

pycryptodome in requirements.txt is not version anchored, so this is not an AP2 problem, but a platform/wheel problem, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants