BVB Source Codes

DeDRM_tools Show pycrypto_des.py Source code

Return Download DeDRM_tools: download pycrypto_des.py Source code - Download DeDRM_tools Source code - Type:.py
  1. #!/usr/bin/env python
  2. # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
  3.  
  4.  
  5. def load_pycrypto():
  6.     try :
  7.         from Crypto.Cipher import DES as _DES
  8.     except:
  9.         return None
  10.  
  11.     class DES(object):
  12.         def __init__(self, key):
  13.             if len(key) != 8 :
  14.                 raise Error('DES improper key used')
  15.             self.key = key
  16.             self._des = _DES.new(key,_DES.MODE_ECB)
  17.         def desdecrypt(self, data):
  18.             return self._des.decrypt(data)
  19.         def decrypt(self, data):
  20.             if not data:
  21.                 return ''
  22.             i = 0
  23.             result = []
  24.             while i < len(data):
  25.                 block = data[i:i+8]
  26.                 processed_block = self.desdecrypt(block)
  27.                 result.append(processed_block)
  28.                 i += 8
  29.             return ''.join(result)
  30.     return DES
  31.  
downloadpycrypto_des.py Source code - Download DeDRM_tools Source code
Related Source Codes/Software:
kcp - KCP - A Fast and Reliable ARQ Protocol 2017-04-08
cloc - cloc counts blank lines, comment lines, and physic... 2017-04-08
nvidia-docker - Build and run Docker containers leveraging NVIDIA ... 2017-04-08
quickstart - Angular 2 QuickStart - source from the documentati... 2017-04-08
jQuery-Autocomplete - Ajax Autocomplete for jQuery allows you to easily ... 2017-04-08
fuckitjs - The Original Javascript Error Steamroller 2017-04-09
eslint-plugin-react - React specific linting rules for ESLint 2017-04-09
husky - 2017-04-09
electron-builder - A complete solution to package and build a ready f... 2017-04-09
jsfeat - JavaScript Computer Vision library. 2017-04-16
flakes - Flakes is an Admin Template Framework. A combinati... 2017-04-15
capstone - Capstone disassembly/disassembler framework: Core ... 2017-04-15
nginx-resources - A collection of resources covering Nginx, Nginx + ... 2017-04-15
utron - A lightweight MVC framework for Go(Golang) 2017-04-15
cfssl - CFSSL: Cloudflare's PKI and TLS toolkit ... 2017-04-15
HandBrake - HandBrake's main development repository ... 2017-04-15
Awesome-Networking - A curated list of awesome networking libraries, re... 2017-04-15
react-sortable-hoc - A set of higher-order components to turn any list ... 2017-04-15
jugglingdb - Multi-database ORM for nodejs: redis, mongodb, mys... 2017-04-15

 Back to top