From 9b62d09ce7a269812370119f39ae53849c32fa9f Mon Sep 17 00:00:00 2001 From: trustedsec Date: Wed, 23 Jan 2013 20:51:00 -0500 Subject: [PATCH] file not done yet --- encrypt.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 encrypt.py diff --git a/encrypt.py b/encrypt.py deleted file mode 100644 index e55d73f7d..000000000 --- a/encrypt.py +++ /dev/null @@ -1,33 +0,0 @@ -from Crypto.Cipher import AES - -def EncryptAES(secret, data): - - # the character used for padding--with a block cipher such as AES, the value - # you encrypt must be a multiple of BLOCK_SIZE in length. This character is - # used to ensure that your value is always a multiple of BLOCK_SIZE - PADDING = '{' - - BLOCK_SIZE = 32 - - # one-liner to sufficiently pad the text to be encrypted - pad = lambda s: s + (BLOCK_SIZE - len(s) % BLOCK_SIZE) * PADDING - - # random value here to randomize builds - a = 50 * 5 - - # one-liners to encrypt/encode and decrypt/decode a string - # encrypt with AES, encode with base64 - EncodeAES = lambda c, s: base64.b64encode(c.encrypt(pad(s))) - DecodeAES = lambda c, e: c.decrypt(base64.b64decode(e)).rstrip(PADDING) - - #secret = os.urandom(BLOCK_SIZE) - cipher = AES.new(secret) - - aes = EncodeAES(cipher, data) - return aes - -secret = os.urandom(32) -fileopen = file("social-engineer-toolkit/src/payloads/set_payloads/multi_pyinjector.binary", "rb") -data = fileopen.read() -encrypted_blob = EncryptAES(secret, data) -filewrite = file("multi_pyinjector.encrypted", "wb")