Skip to content

Commit

Permalink
Replace pycrypto XOR function by code sample provided in kevthehermit#50
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-sgaron authored Nov 10, 2022
1 parent d675ba1 commit 78a8651
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions malwareconfig/crypto.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import itertools
import struct
from Crypto.Cipher import ARC4, DES, DES3, AES, Blowfish, XOR
from Crypto.Cipher import ARC4, DES, DES3, AES, Blowfish
from Crypto.PublicKey import RSA

from pbkdf2 import PBKDF2
Expand All @@ -13,8 +14,7 @@ def decrypt_rsa(key, data):

# XOR
def decrypt_xor(key, data):
cipher = XOR.new(key)
return cipher.decrypt(data)
return bytes([a ^ b for a, b in zip(itertools.cycle(key), data)])


# RC4
Expand Down

0 comments on commit 78a8651

Please sign in to comment.