blob: 5573c775851bf36b781f96e0d079c4c5592e4855 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
Python PSKC module
==================
A Python module to handle Portable Symmetric Key Container (PSKC) files as
defined in `RFC 6030 <https://tools.ietf.org/html/rfc6030>`_. PSKC files are
used to transport and provision symmetric keys and key meta data to different
types of crypto modules. The format is commonly used for one-time password
tokens or other authentication devices.
The goal of this module is mainly to provide parsing of PSKC files in order
to extract secret keys for use in an OTP authentication system. At a later
time support for writing files may be added.
http://arthurdejong.org/python-pskc/
API
---
The module provides a straightforward API that is mostly geared towards
parsing existing PSKC files.
Extracting key matarial from PSKC files is as simple as.
>>> from pskc import PSKC
>>> pskc = PSKC('tests/rfc6030-figure7.pskcxml')
>>> pskc.encryption.derive_key('qwerty')
>>> for key in pskc.keys:
... print key.serial, key.secret
987654321 12345678901234567890
The key object has a number of properties. See the pskc.key.Key documentation
for details.
Security considerations
-----------------------
This code handles private key material and is written in Python. No
precautions have been taken to lock pages in memory to prevent swapping. Also
no attempt is currently made to security dispose of memory that may have held
private key material.
Copyright
---------
Copyright (C) 2014 Arthur de Jong
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA
|