[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@18.224.45.82: ~ $
U

S��W~�@s�dZddlZddlZddlTddlmZzddlmZWnBe	k
rzzddl
mZWne	k
rte	d��YnXYnXe�eje
�e�eje
�e�eje
�Gdd�de�ZGd	d
�d
ee�ZGdd�dee�ZdS)
a�
Peewee integration with pysqlcipher.

Project page: https://github.com/leapcode/pysqlcipher/

**WARNING!!! EXPERIMENTAL!!!**

* Although this extention's code is short, it has not been propery
  peer-reviewed yet and may have introduced vulnerabilities.
* The code contains minimum values for `passphrase` length and
  `kdf_iter`, as well as a default value for the later.
  **Do not** regard these numbers as advice. Consult the docs at
  http://sqlcipher.net/sqlcipher-api/ and security experts.

Also note that this code relies on pysqlcipher and sqlcipher, and
the code there might have vulnerabilities as well, but since these
are widely used crypto modules, we can expect "short zero days" there.

Example usage:

     from peewee.playground.ciphersql_ext import SqlCipherDatabase
     db = SqlCipherDatabase('/path/to/my.db', passphrase="don'tuseme4real",
                            kdf_iter=1000000)

* `passphrase`: should be "long enough".
  Note that *length beats vocabulary* (much exponential), and even
  a lowercase-only passphrase like easytorememberyethardforotherstoguess
  packs more noise than 8 random printable chatacters and *can* be memorized.
* `kdf_iter`: Should be "as much as the weakest target machine can afford".

When opening an existing database, passphrase and kdf_iter should be identical
to the ones used when creating it.  If they're wrong, an exception will only be
raised **when you access the database**.

If you need to ask for an interactive passphrase, here's example code you can
put after the `db = ...` line:

    try:  # Just access the database so that it checks the encryption.
        db.get_tables()
    # We're looking for a DatabaseError with a specific error message.
    except peewee.DatabaseError as e:
        # Check whether the message *means* "passphrase is wrong"
        if e.args[0] == 'file is encrypted or is not a database':
            raise Exception('Developer should Prompt user for passphrase '
                            'again.')
        else:
            # A different DatabaseError. Raise it.
            raise e

See a more elaborate example with this code at
https://gist.github.com/thedod/11048875
�N)�*)�SqliteExtDatabase)�dbapi2z$Sqlcipher python bindings not found.c@seZdZdd�ZdS)�_SqlCipherDatabasecKs�|�dd�}|�dd�}t|�dkr,td��|r@|dkr@td��tj|f|�}|�|�|�d	�|�d
d���|�d�|��|S)
N�
passphrase��kdf_iteri��zESqlCipherDatabase passphrase should be at least eight character long.i'z4SqlCipherDatabase kdf_iter should be at least 10000.zPRAGMA key='{0}'�'z''zPRAGMA kdf_iter={0:d})	�pop�lenZImproperlyConfigured�	sqlcipherZconnectZ_add_conn_hooksZexecute�format�replace)�selfZdatabase�kwargsrr�conn�r�/sqlcipher_ext.py�_connectHs"��
�z_SqlCipherDatabase._connectN)�__name__�
__module__�__qualname__rrrrrrGsrc@seZdZdS)�SqlCipherDatabaseN)rrrrrrrr]srcs(eZdZ�fdd�Z�fdd�Z�ZS)�SqlCipherExtDatabasecsd|d<tt|�j||�dS)NFZc_extensions)�superr�__init__)r�argsr��	__class__rrrbszSqlCipherExtDatabase.__init__cshtt|�j||�}|�|�|�|�|�|�|jr>|j|_|jrd|�	d�|jD]}|�
|�qT|S)NT)rrrZ_load_aggregatesZ_load_collationsZ_load_functionsZ_row_factoryZrow_factoryZ_extensionsZenable_load_extensionZload_extension)rrrr�	extensionrrrrfs




zSqlCipherExtDatabase._connect)rrrrr�
__classcell__rrrrrasr)�__doc__ZdatetimeZdecimalZpeeweeZplayhouse.sqlite_extrZpysqlcipherrr
�ImportErrorZpysqlcipher3Zregister_adapterZDecimal�str�date�time�objectrZSqliteDatabaserrrrrr�<module>s"4

Filemanager

Name Type Size Permission Actions
__init__.cpython-38.opt-1.pyc File 103 B 0644
__init__.cpython-38.pyc File 103 B 0644
apsw_ext.cpython-38.opt-1.pyc File 7.09 KB 0644
apsw_ext.cpython-38.pyc File 7.09 KB 0644
berkeleydb.cpython-38.opt-1.pyc File 2.99 KB 0644
berkeleydb.cpython-38.pyc File 2.99 KB 0644
csv_loader.cpython-38.opt-1.pyc File 141 B 0644
csv_loader.cpython-38.pyc File 141 B 0644
csv_utils.cpython-38.opt-1.pyc File 10.67 KB 0644
csv_utils.cpython-38.pyc File 10.67 KB 0644
dataset.cpython-38.opt-1.pyc File 12.52 KB 0644
dataset.cpython-38.pyc File 12.52 KB 0644
db_url.cpython-38.opt-1.pyc File 2.91 KB 0644
db_url.cpython-38.pyc File 2.91 KB 0644
djpeewee.cpython-38.opt-1.pyc File 5.37 KB 0644
djpeewee.cpython-38.pyc File 5.37 KB 0644
fields.cpython-38.opt-1.pyc File 11.8 KB 0644
fields.cpython-38.pyc File 11.8 KB 0644
flask_utils.cpython-38.opt-1.pyc File 5.57 KB 0644
flask_utils.cpython-38.pyc File 5.6 KB 0644
gfk.cpython-38.opt-1.pyc File 5.68 KB 0644
gfk.cpython-38.pyc File 5.68 KB 0644
hybrid.cpython-38.opt-1.pyc File 2.06 KB 0644
hybrid.cpython-38.pyc File 2.06 KB 0644
kv.cpython-38.opt-1.pyc File 6.41 KB 0644
kv.cpython-38.pyc File 6.41 KB 0644
migrate.cpython-38.opt-1.pyc File 21.11 KB 0644
migrate.cpython-38.pyc File 21.11 KB 0644
pool.cpython-38.opt-1.pyc File 7.52 KB 0644
pool.cpython-38.pyc File 7.52 KB 0644
postgres_ext.cpython-38.opt-1.pyc File 15.81 KB 0644
postgres_ext.cpython-38.pyc File 15.81 KB 0644
read_slave.cpython-38.opt-1.pyc File 1.68 KB 0644
read_slave.cpython-38.pyc File 1.68 KB 0644
reflection.cpython-38.opt-1.pyc File 17.11 KB 0644
reflection.cpython-38.pyc File 17.11 KB 0644
shortcuts.cpython-38.opt-1.pyc File 5.26 KB 0644
shortcuts.cpython-38.pyc File 5.26 KB 0644
signals.cpython-38.opt-1.pyc File 2.86 KB 0644
signals.cpython-38.pyc File 2.86 KB 0644
sqlcipher_ext.cpython-38.opt-1.pyc File 4.38 KB 0644
sqlcipher_ext.cpython-38.pyc File 4.38 KB 0644
sqlite_ext.cpython-38.opt-1.pyc File 34.02 KB 0644
sqlite_ext.cpython-38.pyc File 34.09 KB 0644
sqlite_udf.cpython-38.opt-1.pyc File 15.36 KB 0644
sqlite_udf.cpython-38.pyc File 15.36 KB 0644
sqliteq.cpython-38.opt-1.pyc File 9.03 KB 0644
sqliteq.cpython-38.pyc File 9.03 KB 0644
test_utils.cpython-38.opt-1.pyc File 3.93 KB 0644
test_utils.cpython-38.pyc File 3.96 KB 0644