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