Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install simpleencode

How to install simpleencode

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install simpleencode
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.0.0 Available View build log
Windows (64-bit)
1.0.0 Available View build log
Mac OS X (10.5+)
1.0.0 Available View build log
Linux (32-bit)
1.0.0 Available View build log
Linux (64-bit)
1.0.0 Available View build log
 
Links
License
BSD License
Lastest release
version 1.0.0 on Jan 5th, 2011

simple encode decode w/ private key, based on the base64 encode and decode.

Initially developed for turning database ID's into URL's without exposing the ids in the url, or having a bot iterate over the values.

Also useful for storing passwords which need to be converted back to clear text, in alphanumeric form given a secret word. This is NOT encryption nor a hash. This is NOT cryptographically safe. For that an SSL public/private key pair is preferred. For situations where the encoded string is already protected by a privileged account, and the secret key is stored in a configuration file which is also protected by a privileged login, this system is secure. It is secure by virtue of having all its elements secure, and mitigates the risk of compromise of either one of those vectors (but not both).

This is good for websites which store the secret key in a configuration file on disk, and the encoded word in a database (accessible by a different user), and where both values are not in transactional memory except for the duration of decoding and using the decoded string, which should be immediate.

Requires Python 2.4 or greater

>>> from simpleencode import encode, decode, mksecret
>>> secret_key = mksecret()
>>> secret_key
"{iIb'd/y!%w$'BDL&6NkWf`LeyZvp+}6QFm3~sBQjP)[!8xZ}a"
>>> encoded = encode("Some Text", secret_key)
>>> encoded
'S1lwA3QLQhwBcRJcUxs5fQNSekZjNjwREzFzNSthFh9kNj5PSzl6Cih6HxtWa1lvKhE='
>>> decode(encoded, secret_key)
'Some Text'
>>>

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.