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

Method generate_iv

scapy/layers/ipsec.py:326–332  ·  view source on GitHub ↗

Generate a random initialization vector.

(self)

Source from the content-addressed store, hash-verified

324 (len(key), self.key_size))
325
326 def generate_iv(self):
327 """
328 Generate a random initialization vector.
329 """
330 # XXX: Handle counter modes with real counters? RFCs allow the use of
331 # XXX: random bytes for counters, so it is not wrong to do it that way
332 return os.urandom(self.iv_size)
333
334 @crypto_validator
335 def new_cipher(self, key, mode_iv, digest=None):

Callers 1

_encrypt_espMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected