Debian Codegraph @

README

raw
1 YubiKey C Library: libyubikey
2 =============================
3
4 This package make up the low-level C software development kit for the
5 Yubico https://www.yubico.com[YubiKey] authentication device.
6
7 Building
8 --------
9
10 After downloading and unpacking the package tarball, you build it as
11 follows.
12
13 ./configure
14 make check
15 sudo make install
16
17 Another way to build the package is with a hand written short
18 makefile, invoke using 'make -f simple.mk check'. This is usually not
19 recommended, and you will have to read simple.mk for further
20 information.
21
22 Building from version controlled sources
23 ----------------------------------------
24
25 Warning! This is only for developers and if you don't understand what
26 you are doing, you should download the release files instead.
27
28 You may check out the sources using Git with the following command:
29
30 git clone git://github.com/Yubico/yubico-c.git
31
32 This will create a directory 'yubico-c'. Enter the directory:
33
34 cd yubico-c
35
36 Recent versions of autoconf, automake and libtool must be installed,
37 if you want to use the normal ./configure based approach. AsciiDoc's
38 a2x tool is also required for building the man pages. (See simple.mk
39 if you want a slimmed down non-autoconf build approach.)
40
41 Generate the build system:
42
43 autoreconf --install
44
45 Then refer to the user sections above regarding building.
46
47 Command-line tools
48 ------------------
49
50 The 'modhex' program converts data between modhex, normal hex, and
51 binary form.
52
53 The 'ykparse' program decrypts and parses one OTP given the OTP and
54 the AES key corresponding to that YubiKey.
55
56 The 'ykgenerate' program constructs and encrypts one OTP given AES key
57 and internal data values.
58
59 Example usage:
60
61 [source, sh]
62 -------
63 $ ./modhex test
64 ifhgieif
65 $ ./modhex -d ifhgieif; echo
66 test
67 $ ./modhex -h b565716f
68 nghgibhv
69 $ ./modhex -h -d nghgibhv
70 b565716f
71 $ ./ykparse ecde18dbe76fbd0c33330f1c354871db dteffujedcflcindvdbrblehecuitvjkjevvehjd
72 warning: overlong token, ignoring prefix: dteffuje
73 Input:
74 token: dcflcindvdbrblehecuitvjkjevvehjd
75 20 4a 07 b2 f2 1c 1a 36 30 e7 df 89 83 ff 36 82
76 aeskey: ecde18dbe76fbd0c33330f1c354871db
77 ec de 18 db e7 6f bd 0c 33 33 0f 1c 35 48 71 db
78 Output:
79 87 92 eb fe 26 cc 13 00 a8 c0 00 10 b4 08 6f 5b
80
81 Struct:
82 uid: 87 92 eb fe 26 cc
83 counter: 19 (0x0013)
84 timestamp (low): 49320 (0xc0a8)
85 timestamp (high): 0 (0x00)
86 session use: 16 (0x10)
87 random: 2228 (0x8b4)
88 crc: 23407 (0x5b6f)
89
90 Derived:
91 cleaned counter: 19 (0x0013)
92 modhex uid: jikdunvudhrr
93 triggered by caps lock: no
94 crc: F0B8
95 crc check: ok
96 $ ./ykparse ecde18dbe76fbd0c33330f1c354871db dteffujehknhfjbrjnlnldnhcujvddbikngjrtgh
97 warning: overlong token, ignoring prefix: dteffuje
98 Input:
99 token: hknhfjbrjnlnldnhcujvddbikngjrtgh
100 69 b6 48 1c 8b ab a2 b6 0e 8f 22 17 9b 58 cd 56
101 aeskey: ecde18dbe76fbd0c33330f1c354871db
102 ec de 18 db e7 6f bd 0c 33 33 0f 1c 35 48 71 db
103 Output:
104 87 92 eb fe 26 cc 13 00 30 c2 00 11 c8 9f 23 c8
105
106 Struct:
107 uid: 87 92 eb fe 26 cc
108 counter: 19 (0x0013)
109 timestamp (low): 49712 (0xc230)
110 timestamp (high): 0 (0x00)
111 session use: 17 (0x11)
112 random: 40904 (0x9fc8)
113 crc: 51235 (0xc823)
114
115 Derived:
116 cleaned counter: 19 (0x0013)
117 modhex uid: jikdunvudhrr
118 triggered by caps lock: no
119 crc: F0B8
120 crc check: ok
121 $ ./ykgenerate ecde18dbe76fbd0c33330f1c354871db 8792ebfe26cc 0013 c0a8 00 10
122 hcfktknicvbcnhbkvigcfhgddhhhrknc
123 $ ./ykparse ecde18dbe76fbd0c33330f1c354871db `./ykgenerate ecde18dbe76fbd0c33330f1c354871db 8792ebfe26cc 0013 c0a8 00 10`
124 Input:
125 token: lihggvrgffbjnrehcgnkvknjkvubeekr
126 a7 65 5f c5 44 18 bc 36 05 b9 f9 b8 9f e1 33 9c
127 aeskey: ecde18dbe76fbd0c33330f1c354871db
128 ec de 18 db e7 6f bd 0c 33 33 0f 1c 35 48 71 db
129 Output:
130 87 92 eb fe 26 cc 13 00 a8 c0 00 10 95 44 ec e9
131
132 Struct:
133 uid: 87 92 eb fe 26 cc
134 counter: 19 (0x0013)
135 timestamp (low): 49320 (0xc0a8)
136 timestamp (high): 0 (0x00)
137 session use: 16 (0x10)
138 random: 17557 (0x4495)
139 crc: 59884 (0xe9ec)
140
141 Derived:
142 cleaned counter: 19 (0x0013)
143 modhex uid: jikdunvudhrr
144 triggered by caps lock: no
145 crc: F0B8
146 crc check: ok
147 $
148 -------
149
150 License
151 -------
152
153 The project is licensed under a BSD license. See the file COPYING for
154 exact wording. For any copyright year range specified as YYYY-ZZZZ in
155 this package note that the range specifies every single year in that
156 closed interval.