def _loadLibrary(): global hdll global hstart global hread global hwrite global hfinish if hdll is None: hdll = libload.loadLibrary('./plugins/crypt/xor/', 'cryptxor') hstart = libload.getExportFunction(hdll, 'cryptxor_start') hread = libload.getExportFunction(hdll, 'cryptxor_read') hwrite = libload.getExportFunction(hdll, 'cryptxor_write') hfinish = libload.getExportFunction(hdll, 'cryptxor_finish')
def _loadlibrary(): global hdll global hstart global hread global hwrite global hfinish if hdll is None: hdll = libload.loadLibrary('./plugins/crypt/xor/', 'cryptxor') hstart = libload.getExportFunction(hdll, 'cryptxor_start') hread = libload.getExportFunction(hdll, 'cryptxor_read') hwrite = libload.getExportFunction(hdll, 'cryptxor_write') hfinish = libload.getExportFunction(hdll, 'cryptxor_finish')
import struct import os import math import time import lib.flycatcher as flycatcher logger = flycatcher.getLogger('plugin.crypt.scryptaesctr') gvector = 0 ''' THIS SECTION BUILDS THE INTERFACE TO THE NATIVE LIBRARY ''' _hdll = libload.loadLibrary('./plugins/crypt/scryptaesctr/', 'scryptaesctr') if _hdll is not None: _hscryptenc_buf = libload.getExportFunction(_hdll, 'scryptenc_buf') _hscryptdec_buf = libload.getExportFunction(_hdll, 'scryptdec_buf') _hscryptenc_file = libload.getExportFunction(_hdll, 'scryptenc_file') _hscryptdec_file = libload.getExportFunction(_hdll, 'scryptdec_file') _hscryptenc_path = libload.getExportFunction(_hdll, 'scryptenc_path') _hscryptdec_path = libload.getExportFunction(_hdll, 'scryptdec_path') _hscryptkdf = libload.getExportFunction(_hdll, 'scryptkdf') _hgetparamsize = libload.getExportFunction(_hdll, 'getparamsize') _aes256ctr_init = libload.getExportFunction(_hdll, 'aes256ctr_init') _aes256ctr_crypt = libload.getExportFunction(_hdll, 'aes256ctr_crypt') _aes256ctr_done = libload.getExportFunction(_hdll, 'aes256ctr_done') _aes256ctr_getcontextsize = libload.getExportFunction(_hdll, 'aes256ctr_getcontextsize') else: raise Exception('OOPS - DEBUGGING') '''
import struct import os import math import time import lib.flycatcher as flycatcher logger = flycatcher.getLogger('plugin.crypt.scryptaesctr') gvector = 0 ''' THIS SECTION BUILDS THE INTERFACE TO THE NATIVE LIBRARY ''' _hdll = libload.loadLibrary('./plugins/crypt/scryptaesctr/', 'scryptaesctr') if _hdll is not None: _hscryptenc_buf = libload.getExportFunction(_hdll, 'scryptenc_buf') _hscryptdec_buf = libload.getExportFunction(_hdll, 'scryptdec_buf') _hscryptenc_file = libload.getExportFunction(_hdll, 'scryptenc_file') _hscryptdec_file = libload.getExportFunction(_hdll, 'scryptdec_file') _hscryptenc_path = libload.getExportFunction(_hdll, 'scryptenc_path') _hscryptdec_path = libload.getExportFunction(_hdll, 'scryptdec_path') _hscryptkdf = libload.getExportFunction(_hdll, 'scryptkdf') _hgetparamsize = libload.getExportFunction(_hdll, 'getparamsize') _aes256ctr_init = libload.getExportFunction(_hdll, 'aes256ctr_init') _aes256ctr_crypt = libload.getExportFunction(_hdll, 'aes256ctr_crypt') _aes256ctr_done = libload.getExportFunction(_hdll, 'aes256ctr_done') _aes256ctr_getcontextsize = libload.getExportFunction( _hdll, 'aes256ctr_getcontextsize') else: raise Exception('OOPS - DEBUGGING') '''
from ctypes import create_string_buffer from ctypes import c_size_t from ctypes import c_double from ctypes import c_uint8 from lib import libload class Scrypt: pass class AESCTR256: pass _hdll = libload.loadLibrary('./plugins/crypt/scryptaesctr/', 'scryptaesctr') if _hdll is not None: _hscryptenc_buf = libload.getExportFunction(_hdll, 'scryptenc_buf') _hscryptdec_buf = libload.getExportFunction(_hdll, 'scryptdec_buf') _hscryptenc_file = libload.getExportFunction(_hdll, 'scryptenc_file') _hscryptdec_file = libload.getExportFunction(_hdll, 'scryptdec_file') _hscryptkdf = libload.getExportFunction(_hdll, 'scryptkdf') ''' static int scryptkdf( uint8_t *passwd, size_t passwdlen, uint8_t *dk, size_t dklen, double maxmem, double maxmemfrac, double maxtime ) ''' def hscryptkdf(password, dklen, maxmem, maxmemfrac, maxtime): dk = create_string_buffer(dklen)