Warning Messages from Scapy

Warning Messages from Scapy

Using this:

from scapy.all import *

I've got these two warnings which I want to remove

Warning (from warnings module): File "C:\Users\localfp\AppData\Local\Programs\Python\Python310\lib\site-packages\scapy\layers\ipsec.py", line 471 cipher=algorithms.Blowfish, CryptographyDeprecationWarning: Blowfish has been deprecated

Warning (from warnings module): File "C:\Users\localfp\AppData\Local\Programs\Python\Python310\lib\site-packages\scapy\layers\ipsec.py", line 485 cipher=algorithms.CAST5, CryptographyDeprecationWarning: CAST5 has been deprecated

Unfortunately I've found the solution for this kind of error only for paramiko.

I'm using this in order to sniff packets from an ethernet II connection. Is there a way to remove these two warnings?

3 Answers

It worked using code like this (I'm using python 3):

from warnings import filterwarnings
filterwarnings("ignore")

A more general solution (if you only want to ignore the CryptographyDeprecationWarning) but keep the rest of the warnings:

import warnings
from cryptography.utils import CryptographyDeprecationWarning
warnings.filterwarnings("ignore", category=CryptographyDeprecationWarning)

from scapy.all import *

This is apparently fixed in and will be included in Scapy 2.5.0+ (use the github version in the meantime)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.