I am trying to install yenc using pip in Linux
pip install yenc
However I received the error below

Same with pip3
pip3 install yenc
I tried multiple suggested online solutions but no luck (Shown below)
sudo apt-get update
python -m pip install --upgrade pip
pip install --upgrade pip
pip3 install --upgrade pip
pip install --upgrade pip setuptools wheel
pip3 install --upgrade pip setuptools wheel
sudo apt-get install libxml2-dev libxmlsec1-dev
pip install p5py
pip3 install p5py
pip install PEP517
pip3 install PEP517
pip3 install yenc
sudo apt-get install -y pkg-config
sudo apt-get install libsuitesparse-dev
My current pip version
pip --version
pip 23.2.1
My current python version
python3 --version
Python 3.10.4
**Follow Up**
As suggested I installed yenc on Python2,7 using pip2.7
pip2.7 install yenc
Installation succeeded
Successfully installed yenc-0.4.0
I run the script and got the following error
ERROR: Loading module scapy.layers.ipsec
Traceback (most recent call last):
File "/home/kali/.local/lib/python2.7/site-packages/scapy/main.py", line 156, in _load
mod = importlib.import_module(module)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/kali/.local/lib/python2.7/site-packages/scapy/layers/ipsec.py", line 163, in <module>
from cryptography.hazmat.primitives.ciphers import (
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/aead.py", line 10, in <module>
from cryptography.hazmat.backends.openssl import aead
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
from cryptography import utils, x509
File "/usr/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
Traceback (most recent call last):
File "yenc.py", line 5, in <module>
import yenc
File "/home/kali/Documents/HidenInPlain/yenc.py", line 12, in <module>
decoded = yenc.decode("./data","./result")
AttributeError: 'module' object has no attribute 'decode'
Following online documentation, I'm sure that decode is an actual attribute of yenc, unlike what the error suggest.
References:
Here is the Python script:
# Using Python
#!/usr/bin/python
from scapy.all import *
import yenc
pkts = rdpcap("./merge.pcap")
file = open("./data","w")
for i in range(0,len(pkts)):
file.write(pkts[i].load)
deco = yenc.decode("./data","./result")
Follow Up
I tried renaming my script (yenc.py) to another name, I got a different error this time
ERROR: Loading module scapy.layers.ipsec
Traceback (most recent call last):
File "/home/kali/.local/lib/python2.7/site-packages/scapy/main.py", line 156, in _load
mod = importlib.import_module(module)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/kali/.local/lib/python2.7/site-packages/scapy/layers/ipsec.py", line 163, in <module>
from cryptography.hazmat.primitives.ciphers import (
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/primitives/ciphers/aead.py", line 10, in <module>
from cryptography.hazmat.backends.openssl import aead
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
from cryptography import utils, x509
File "/usr/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency