AES Decryption Regex, Then Encryption With MITMPROXY

Need Help creating a Python Script to be used with Mitmproxy / Mitmdump ( [url removed, login to view] )

command switch as mitmproxy -s /home/user/[url removed, login to view]

In this script i need it to do the following:

get the servers Response or Request and be able to decrypt them via AES / Rijndael-128 / ECB / with Base64 Encoding, Then Edit those Responses and Request via RE (Regex) and then Encrypt Them back with the same Key (Provided via a variable).

I have tried this a few time myself with little luck, but I don't know py very well.

The hard part is to get the decrytion and encryption correct!

To test and make sure it does it the way i need, the Script MUST encrypt and decrypt at these sites:

[url removed, login to view] (Auto detects, but it should be Rijndael-128 / ECB / with Base64)

[url removed, login to view] (Rijndael-128 / ECB / with Base64)

[url removed, login to view] (Rijndael-128 / ECB / with Base64)

so to test your work, please make sure you get the same input and out put as those sites.

The Response and Request will NOT be all plaintext, most of the time it's JASON, so this will need to support this. (another issue i ran into).

Here is an Example of a Key I use and what part of a reply might look like, to test with:

key = '3te0Lszj'

encrypteddate = '9qSBmNW40COlkSHaRz/Vw0XB3x2GYzWZUZs0mQgOaKTqKRw65Ki0ngYAu0o6P+1FDlc572BAiMRySEy9ISli6P9xGw0KeIRLShONFQZB/98='

Decrypted data = '{"N3hB0CwE":"10002","9GIvAQC2":"5","1Fa7rL5R":"22:504100030:2:90"},'

*And reverse.

BUT i will need to pull this encrypted area from the Response or Request first. cause most of the time it will come in like this:


and I only want to Decrypt 9qSBmNW40COlkSHaRz/Vw0XB3x2GYzWZUZs0mQgOaKTqKRw65Ki0ngYAu0o6P+1FDlc572BAiMRySEy9ISli6P9xGw0KeIRLShONFQZB/98=

Then Regex that Decrypted JSON

Then Re-Encrypt it using the same Key as I provide to Decrypt it

Then put it back where I pulled it from.

This script needs to get and output the info through mitmproxy, i would only like to edit my regex and the key after each "if [url removed, login to view]("[url removed, login to view]"):"

I'll upload what script i use today that works, but does have AES; which i mainly all i need added.

The versions of MITMPROXY use a little different code.

I would prefer the older versions code, as i will share the script i use for that one.

Version 0.16 ( pip install mitmproxy==0.16 ) with py version 2.7

*Ii wouldn't mind if you used the newest release and py version 3.x (as next version they will force Py 3.x)

Thank you.

Skills: Python

See more: basic encryption and decryption techniques, i need a statistician to work with, encryption and decryption, encryption decryption using aes openssl, encryption decryption aes documentation, encryption java decryption, program aes encryption decryption java, aes encryption decryption java source code, encryption iphone decryption net, php encryption foxpro decryption, javascript encryption java decryption, software write mq4, software write chip epson, useful software write book, software write web specs, net aes encryption java decryption code, free software write user guide, aes java encryption net decryption, software write edid, free software write company profile, software write websites idea, software write book images, aes encryption decryption java code, software write books, software write protection

About the Employer:
( 8 reviews ) los angeles, United States

Project ID: #12122149

Awarded to:

$30 USD in 1 day
(8 Reviews)