Tag Archives: python

(Python) Simple XOR Hash

This is a simple hash that pads its input to the block size and XORs every block together. Output is in hexadecimal octets.

Posted in Python | Also tagged , , , , , , | Leave a comment

(Python) ARC4

This is a pure Python implementation of raw ARC4, sans any improvements. For instance, it could take a nonce, use multiple state spaces (parallelizable), automatically discard the first 4K of the state space(s), use a more complex transformation than a simple swap, limit the # of bytes encrypted per nonce, etc.. The size of the [...]

Posted in Python | Also tagged , , , , , | Leave a comment

(Python) All-Or-Nothing Transform

Performs an all-or-nothing transform on a stream of chunks. The data can only be decrypted if every block is present to generate an HMAC for. The list of HMACs is then XOR’d against the final block from the transform, yielding the decryption key for the blocks. Currently uses the HMAC key for encryption as well [...]

Posted in Python | Also tagged , , , , , , | Leave a comment

(Python) HMAC

HMAC, pass a hash from Crypto.Hash in PyCrypto. Key should be a bytes object. Returns a bytearray.

Posted in Python | Also tagged , , , , | Leave a comment

(Python) Chunk Data for Streaming

Chunks data into block_size blocks for streaming, adds null padding.

Posted in Python | Also tagged , , , | Leave a comment

(Python) Password Strength Checker

This is based on the JavaScript snippet at the snippler URL listed. It in turn referenced a page that is no longer available. So I have decided to make my pythonification of the JavaScript available for others instead of hoarding it.

Posted in Python | Also tagged , , , , | Leave a comment

(Python) Dynamically obtain absolute path of project_folder

Hard-coding absolute paths is never ideal so here’s a quick way to reference your project folder

Posted in Python | Also tagged , , , , , | Leave a comment

Python: local and global namespaces

// Scoping in Python revolves around the concept of namespaces. Namespaces are basically dictionaries containing the names and values of the objects within a given scope. There are four basic types of namespaces that you will be dealing with: the global, local, module, and class namespaces. Global namespaces are created when a program begins execution. [...]

Posted in Python | Also tagged , , , , , , , , | Leave a comment

(Python) Get ID3 from MP3 File

// Python – Get id3 from MP3 File

Posted in Python | Also tagged , , , , , , , , , | Leave a comment

(Python) Statistical String Comparison

http://docs.python.org/library/difflib.html

Posted in Python | Also tagged , , , , | Leave a comment