warning about offsiting the qrcode generation...
[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
37 How?
38 ====
39
40 Ultimately, this is just a library with a web based example,
41 the purpose of which is to integrate into your exisint applications,
42 those that are PHP.
43
44
45 Complications
46 =============
47
48 The only real complication i've had so far is that alot of the
49 HOTP based keys out there provide the secret key as HEX where
50 google choose to use base32, of which there exist no single
51 or simple implementation. So I wrote my (rather terrible so far)
52 own as all i really want to do is convert from base32 back to
53 hex, this I do by converting to binary first... Lets how thats
54 going to work in the long run. The sad thing is is that if I
55 were writing it in C/C++/etc, bit math is easy and while im sure
56 its not too different in PHP, I've never done it, so this seeemed
57 easier.   
58
59
60 Acknowledgements
61 ================
62
63 Google, for producing google authenticator
64 The guys at mOTP who got me all excited about token authenticators
65 The guys on this page who spell out how to do hotp
66         http://php.net/manual/en/function.hash-hmac.php