Skip to content

Instantly share code, notes, and snippets.

View xarses's full-sized avatar

Andrew Woodward xarses

  • San Francisco, Bay Area, CA
View GitHub Profile
from Crypto.Cipher import DES
from hashlib import md5
class PBEWithMD5AndDES(object):
"""PBES1 implementation according to RFC 2898 section 6.1"""
SALT = '\x0c\x9d\x4a\xe4\x1e\x83\x15\xfc'
COUNT = 5
def __init__(self, key):
key = self._generate_key(key, self.SALT, self.COUNT, 16)