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

Method string_to_key

scapy/libs/rfc3961.py:1059–1064  ·  view source on GitHub ↗
(cls, string, salt, params)

Source from the content-addressed store, hash-verified

1057
1058 @classmethod
1059 def string_to_key(cls, string, salt, params):
1060 # type: (bytes, bytes, Optional[bytes]) -> Key
1061 if params is not None and params != b"":
1062 raise ValueError("Invalid RC4 string-to-key parameters")
1063 utf16string = plain_str(string).encode("UTF-16LE")
1064 return Key(cls.etype, key=Hash_MD4().digest(utf16string))
1065
1066 @classmethod
1067 def encrypt(cls, key, keyusage, plaintext, confounder):

Callers

nothing calls this directly

Calls 5

plain_strFunction · 0.90
Hash_MD4Class · 0.90
KeyClass · 0.85
encodeMethod · 0.80
digestMethod · 0.45

Tested by

no test coverage detected