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

Function ARC4_encrypt

scapy/modules/krack/crypto.py:20–29  ·  view source on GitHub ↗

Encrypt data @data with key @key, skipping @skip first bytes of the keystream

(key, data, skip=0)

Source from the content-addressed store, hash-verified

18
19
20def ARC4_encrypt(key, data, skip=0):
21 """Encrypt data @data with key @key, skipping @skip first bytes of the
22 keystream"""
23
24 algorithm = algorithms.ARC4(key)
25 cipher = Cipher(algorithm, mode=None, backend=default_backend())
26 encryptor = cipher.encryptor()
27 if skip:
28 encryptor.update(b"\x00" * skip)
29 return encryptor.update(data)
30
31
32def ARC4_decrypt(key, data, skip=0):

Callers 3

ARC4_decryptFunction · 0.85
build_TKIP_payloadFunction · 0.85

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…