Migrating wiki contents from Google Code

This commit is contained in:
Google Code Exporter 2015-04-26 11:44:57 -04:00
commit 61984b7f26
4 changed files with 164 additions and 0 deletions

25
Faq.md Normal file
View file

@ -0,0 +1,25 @@
## Should I use Ciform over HTTPS ? ##
No you should not : if the form's page is accessed through HTTPS, then the data is already securely submitted.
Ciform can be seen as a light replacement for HTTPS when it is not available, but it is not as much secure and only provides encryption (not authentication).
Of course, it will still work if you do Ciform over HTTPS...
## What if the navigator does not support Javascript ? ##
If Javascript is not available, the form will still be accessible, but the data will be submitted unencrypted, like if Ciform never existed.
This is also true when Javascript is disabled through the navigator's preferences.
# Common error messages #
## oktags.containsValue is not a function ##
Check that you pass an array to the Javascript encryption functions :
`myCipher.encryptForm(this,{allowTypes:['password']});`
not :
`myCipher.encryptForm(this,{allowTypes:'password'});`

48
Introduction.md Normal file
View file

@ -0,0 +1,48 @@
# Everyone can read your password ! #
To understand what Ciform is made for, you first need to know one thing : when you submit a form on a website whose URL starts with "http://" (not "https://"), the data is sent through the Internet **as clear text** most of the time (if you know this already you can skip to the next chapter).
That means that anybody "looking" at the data you send will see it in clear, including passwords<sup>*</sup>.
Let me explain : when you submit a form on the web, the data is sent from your machine to the website. But it does not go straight to it : it goes through a whole route of machines over the Internet until it reaches the server of the web site you're surfing on. For instance, it could first go to your Internet access provider's gateway, then to the first router computer, then to another one, etc. up to the website's server.
It's [relatively easy](http://www.google.fr/search?q=packet+sniffer) to intercept the _packets_ of data during this routing phase and read your data inside.
This is an important security issue of the Internet architecture which is not always well understood by newcomers.
As a remedy to this kind of problem, the "HTTPS" protocol was invented. With HTTPS, the data is transmitted through a secure channel between your computer and the website, so nobody else can read it <sup>**</sup>.
However, HTTPS is still not so widely used, especially on free hosts, for different reasons (certificate cost, high processor and bandwidth consumption, …).
<sup>*</sup> Even if passwords are usually hidden on the screen, they are sent in clear like any other field when the form is submitted
<sup>**</sup> Actually, the data is still transmitted through the same route, but is encrypted, making it impossible for others to read your data inside
# What is Ciform ? #
Ciform aims to be the "poor's replacement for HTTPS" : it encrypts web form fields before you submit them, so your data is not sent as clear text through the Internet.
To do that, it requires :
**1. A Javascript-enabled web browser**
For users, this just means to have a recent version of a web browser with Javascript enabled (see [Faq](Faq.md)).
For web admins : the client-side part of Ciform (a Javascript library) will encrypt the fields given a set of options.
**2. A Ciform-enabled web site**
For web admins : the server-side part of Ciform provides a set of functions in different languages for integration with existing forms and decryption of the submitted data.
Users might appreciate to recognize a site where Ciform is enabled : a common style is provided by default to decorate 'ci'-forms.
# Where do I start ? #
You could check [the demo](Demo.md) first, to see Ciform at work.
If you are a user seeking for privacy, you could ask the webmaster of the website(s) to add Ciform, or better : to provide HTTPS access.
If you are a webmaster / web developer, you should read [the manual](Manual.md) to learn how to add Ciform to a website.

78
Manual.md Normal file
View file

@ -0,0 +1,78 @@
# Introduction #
This article explains everything you need to integrate Ciform in your web site / application.
# Get Ciform #
Ciform is available as different artifacts depending on your needs :
* **a unique Javascript file** : `libciform.js`. Only one file to include in your HTML. No further dependency required.
* **several Javascript files** : `hex.js`, `base64.js`, `sha1.js`, `rsa.js`, `ciform.js`. If you have specific needs and wish to replace part of the dependent libraries. You will need to include each of them in your HTML.
* **minified versions** : same as previous but their name ends with "`-min.js`". They contain compressed Javascript code and therefore are not human-readable. Use for production sites.
You may get them using one of the following way :
## Download from Google Code ##
Simply download the file you need from [the downloads section](http://code.google.com/p/ciform/downloads).
## With Maven or Ivy ##
Not yet.
# Install Ciform #
## Client side overview ##
First you will have to include the javascript library in the web page served to the client :
```
<script type="text/javascript" src="/js/libciform.js"></script>
```
Then you will have to initialize Ciform with code similar to the following snippet :
```
<script type="text/javascript">
// defines a public RSA key in a form that Javascript can handle
var myKey = {type:'rsa', size:768, p:[37236049,101016772,159282282,175757624,13024433,250498477,84607479,59966049,22498627,132597430,110924424,205232890,182507213,1044302], q:[107105531,186247335,15521988,62026032,158753359,206244312,50260951,80974433,210269537,225192697,68222441,99922802,211387762,867338], e:[65537], pq:[160070251,12494788,234241229,42365211,94290208,134162236,244093543,74703011,240555106,131172205,88099880,17392319,71011601,227180618,186191532,166269392,147618953,23626137,184395548,183496469,162940002,117707274,143317218,151429299,185738169,204772714,62991596,3374]};
// creates a 'Ciform.Cipher' object to work with
myCipher = new Ciform.Cipher({pubKey:myKey});
</script>
```
Or you could use the provided server-side script to initialize it for you :
```
<!-- Defines a public cryptographic key with default parameters as a global Javascript variable named 'myKey' and initializes a Cipher as variable 'myCipher' -->
<script type="text/javascript" src="/lib/ciform/ciform.php?action=genKey&keyVar=myKey&action=genCipher&cipherVar=myCipher"></script>
```
Finally, to trigger encryption, you would use code like this where you need to :
```
<FORM action="http://myserver/mypage.php" onsubmit="myCipher.encryptForm(this,{allowTypes:['password']});">
...
```
Ciform is independent from any javascript framework and lets you call the encryption function where and when you want (see [Javascript API](http://wiki.ciform.googlecode.com/hg/api/js/files.html) for details).
## Server side overview ##
On the server side, the easiest way to go is to let the API do all the work : just include the required dependencies and the fields identified as 'ciform-ed' will automatically be decrypted.
For instance, in PHP :
```
// makes sure required libraries are in the path (optional but recommended)
set_include_path("/opt/PEAR/".PATH_SEPARATOR.get_include_path().PATH_SEPARATOR."/opt/ciform/");
// imports the front script and automatically decrypts query fields
require_once("ciform.php");
..
// the fields in the HTTP request are automatically available in clear
echo "<p>Your password is " . $_REQUEST['myPassword'] . "</p>";
```
# Examples #
_TODO_

13
ProjectHome.md Normal file
View file

@ -0,0 +1,13 @@
![http://cbonar.free.fr/plugnauth/dokuwiki/logo_ciform.png](http://cbonar.free.fr/plugnauth/dokuwiki/logo_ciform.png)
Ciform aims to be the "poor's replacement for HTTPS" : it encrypts web form fields before you submit them, so your data is not sent in clear text over the Internet.
To do that, it requires :
1. a Javascript-enabled web navigator
1. a Ciform-enabled web site.
To enable Ciform on a web site, server-side API are available in different languages (PHP, Java).
If you want to know more, just start with the [Introduction](Introduction.md).
If you want to start using Ciform, please look at the [Manual](Manual.md).