MCPcopy Create free account
hub / github.com/secdev/scapy / isCryptographyAdvanced

Function isCryptographyAdvanced

scapy/config.py:758–774  ·  view source on GitHub ↗

Check if the cryptography module is present, and if it supports X25519, ChaCha20Poly1305 and such. Notes: - cryptography >= 2.0 is required - OpenSSL >= 1.1.0 is required

()

Source from the content-addressed store, hash-verified

756
757
758def isCryptographyAdvanced():
759 # type: () -> bool
760 """
761 Check if the cryptography module is present, and if it supports X25519,
762 ChaCha20Poly1305 and such.
763
764 Notes:
765 - cryptography >= 2.0 is required
766 - OpenSSL >= 1.1.0 is required
767 """
768 try:
769 from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey # noqa: E501
770 X25519PrivateKey.generate()
771 except Exception:
772 return False
773 else:
774 return True
775
776
777def isCryptographyBackendCompatible() -> bool:

Callers 1

ConfClass · 0.85

Calls 1

generateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…