!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache/2.4.18 (Ubuntu). PHP/7.0.33-0ubuntu0.16.04.16 

uname -a: Linux digifus 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/gregoryteam_api/flask_restful/utils/   drwxr-xr-x
Free 10.12 GB of 29.4 GB (34.44%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     crypto.py (996 B)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
import pickle
from Crypto.Cipher import AES
from base64 import b64encode, b64decode


__all__ = "encrypt", "decrypt"

BLOCK_SIZE = 16
INTERRUPT = b'\0'  # something impossible to put in a string
PADDING = b'\1'


def pad(data):
    return data + INTERRUPT + PADDING * (BLOCK_SIZE - (len(data) + 1) % BLOCK_SIZE)


def strip(data):
    return data.rstrip(PADDING).rstrip(INTERRUPT)


def create_cipher(key, seed):
    if len(seed) != 16:
        raise ValueError("Choose a seed of 16 bytes")
    if len(key) != 32:
        raise ValueError("Choose a key of 32 bytes")
    return AES.new(key, AES.MODE_CBC, seed)


def encrypt(plaintext_data, key, seed):
    plaintext_data = pickle.dumps(plaintext_data, pickle.HIGHEST_PROTOCOL)  # whatever you give me I need to be able to restitute it
    return b64encode(create_cipher(key, seed).encrypt(pad(plaintext_data)))


def decrypt(encrypted_data, key, seed):
    return pickle.loads(strip(create_cipher(key, seed).decrypt(b64decode(encrypted_data))))

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0053 ]--