This works with Crypto.Cipher.ARC4 (from python*-crypto) and
fallback to M2Crypto.RC4.RC4 (from [python*-]m2crypto).
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
return blob
+def arcfour_encrypt(key, data):
+ try:
+ from Crypto.Cipher import ARC4
+ c = ARC4.new(key)
+ return c.encrypt(data)
+ except ImportError as e:
+ pass
+ try:
+ from M2Crypto.RC4 import RC4
+ c = RC4(key)
+ return c.update(data)
+ except ImportError as e:
+ pass
+ raise Exception("arcfour_encrypt() requires " +
+ "python*-crypto or python*-m2crypto or m2crypto")
+
import _glue
version = _glue.version
interface_ips = _glue.interface_ips