Warning messages from scapy

Question:

Using this:

from scapy.all import *

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

Warning (from warnings module): File
"C:UserslocalfpAppDataLocalProgramsPythonPython310libsite-packagesscapylayersipsec.py",
line 471
cipher=algorithms.Blowfish, CryptographyDeprecationWarning: Blowfish has been deprecated

Warning (from warnings module): File
"C:UserslocalfpAppDataLocalProgramsPythonPython310libsite-packagesscapylayersipsec.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?

Asked By: martinmistere

||

Answers:

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

from warnings import filterwarnings
filterwarnings("ignore")
Answered By: martinmistere

This is apparently fixed in https://github.com/secdev/scapy/pull/3645 and will be included in Scapy 2.5.0+ (use the github version in the meantime)

Answered By: Cukic0d

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 *
Answered By: seveneights
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.