6e8da30e6be13e6f455805de313eb9f9ffc10056
[ga4php.git] / doco / readme.txt
1 /* Note: This readme is moderately out of day, go see the GA4PHP
2 Wiki - http://code.google.com/p/ga4php/w/list But i'll keep the
3 file around for historical reasons */
4
5
6 The GA4PHP Project
7 ==================
8
9 GA4PHP means Google Authenticator for PHP.
10
11 The purpose of this "library" is to provde a convienient and
12 hopefully simple way of provisioning and authenticating users
13 using the Google Authenticator mechanism. For now this lib
14 will only support GA's hotp methods.
15
16
17 Why?
18 ====
19
20 Mostly cause I can. Recently i've been heavily interesting in
21 what is "out there" for FOSS based authentication projects and
22 the Google Authenticator is based on OATH - HOTP/TOTP. It also
23 has a few kewl features, like providing its secret key via QR
24 codes. But looking at the App's available for smartphones
25 (android, iphone, etc), the google auth app was the only one
26 that fullfilled some realistic criteria - easy to use, easy to
27 provision.
28
29
30 READ THIS BIT
31 =============
32
33 in the example page, i send a url off to google charts to create
34 the QRCode. NEVER EVER EVER EVER EVER do this. I do it cause for
35 the example it doesnt matter, and if i find a better way of doing
36 it i'll do it. BUT creating a qrcode on a page aint terribly easy.
37 The point is, that QR code is a URL containing the tokens SECRET
38 KEY and should remain secret. You can generate qrcodes anyway you
39 like, BUT MAKE SURE ITS SECURE (i.e. never save them on the FS,
40 and send them all over ssl).
41
42 If your running on linux, most distro's have a program called
43 qrencode that you can use.
44
45
46 How?
47 ====
48
49 Ultimately, this is just a library with a web based example,
50 the purpose of which is to integrate into your exisint applications,
51 those that are PHP.
52
53
54 Usage
55 =====
56 ... TODO ...
57
58
59 Complications
60 =============
61
62 The only real complication i've had so far is that alot of the
63 HOTP based keys out there provide the secret key as HEX where
64 google choose to use base32, of which there exist no single
65 or simple implementation. So I wrote my (rather terrible so far)
66 own as all i really want to do is convert from base32 back to
67 hex, this I do by converting to binary first... Lets how thats
68 going to work in the long run. The sad thing is is that if I
69 were writing it in C/C++/etc, bit math is easy and while im sure
70 its not too different in PHP, I've never done it, so this seeemed
71 easier.   
72
73
74 Acknowledgements
75 ================
76
77 Google, for producing google authenticator
78 The guys at mOTP who got me all excited about token authenticators
79 The guys on this page who spell out how to do hotp
80         http://php.net/manual/en/function.hash-hmac.php