

BYTE ))) 70 blobout = DATA_BLOB () 71 72 if not CryptProtectData ( byref (blobin ), 73 u ( 'python-keyring-lib.win32crypto' ), 74 None, None, None, 75 CRYPTPROTECT_UI_FORBIDDEN, 76 byref (blobout )): 77 raise OSError ( "Can't encrypt" ) 78 79 encrypted = create_string_buffer (blobout.
TASK COACH PYTHON .DLL
DWORD, POINTER (DATA_BLOB ))( 61 ( 'CryptUnprotectData', _dll )) 62 63 # Functions 64 65 66 def encrypt (data, non_interactive = 0 ): 67 blobin = DATA_BLOB (cbData = len (data ), 68 pbData = cast ( c_char_p (data ), 69 POINTER (wintypes. WCHAR ), 57 POINTER (DATA_BLOB ), 58 c_void_p, 59 POINTER (CRYPTPROTECT_PROMPTSTRUCT ), 60 wintypes. BOOL, 55 POINTER (DATA_BLOB ), 56 POINTER (wintypes.

DWORD, 52 POINTER (DATA_BLOB ))(( 'CryptProtectData', _dll )) 53 54 CryptUnprotectData = WINFUNCTYPE (wintypes. WCHAR ), 48 POINTER (DATA_BLOB ), 49 c_void_p, 50 POINTER (CRYPTPROTECT_PROMPTSTRUCT ), 51 wintypes. BOOL, 46 POINTER (DATA_BLOB ), 47 POINTER (wintypes. escape import u 12 13 # Crypto API ctypes bindings 14 15 class DATA_BLOB (Structure ): 16 _fields_ = 18 19 20 class CRYPTPROTECT_PROMPTSTRUCT (Structure ): 21 _fields_ = 25 26 # Flags for CRYPTPROTECT_PROMPTSTRUCT 27 28 CRYPTPROTECT_PROMPT_ON_UNPROTECT = 1 29 CRYPTPROTECT_PROMPT_ON_PROTECT = 2 30 31 # Flags for CryptProtectData/CryptUnprotectData 32 33 CRYPTPROTECT_UI_FORBIDDEN = 0x01 34 CRYPTPROTECT_LOCAL_MACHINE = 0x04 35 CRYPTPROTECT_CRED_SYNC = 0x08 36 CRYPTPROTECT_AUDIT = 0x10 37 CRYPTPROTECT_NO_RECOVERY = 0x20 38 CRYPTPROTECT_VERIFY_PROTECTION = 0x40 39 CRYPTPROTECT_CRED_REGENERATE = 0x80 40 41 # Crypto API Functions 42 43 _dll = WinDLL ( 'CRYPT32.DLL' ) 44 45 CryptProtectData = WINFUNCTYPE (wintypes.

TASK COACH PYTHON CODE
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers.Īlternatively you can here view or download the uninterpreted source code file.ġ 2 from ctypes import Structure, POINTER, c_void_p, cast, create_string_buffer, \ 3 c_char_p, byref, memmove 4 from ctypes import windll, WinDLL, WINFUNCTYPE 5 try : 6 from ctypes import wintypes 7 except ValueError : 8 # see 9 raise ImportError ( "wintypes" ) 10 11 from.
