Add Documentation

master
Bronwen 2020-02-27 16:40:51 -05:00
parent 9990198149
commit cb48f7ffc8
3 changed files with 118 additions and 1 deletions

35
README.md 100644
View File

@ -0,0 +1,35 @@
# Socurity
Socurity is a PKI approach to SSO. It utilizes a local Identity server for storing keypairs, and a chrome/firefox extension to facilitate communication and provide a front end with/for said server.
This is mostly academic in nature, but serves to prove that very basic PKI can be used in place of traditional username/password as an account model.
## Extension
the `/extension` folder is the root of the unpacked extension.
### Installation
- navigate to `edge://extensions` or `chrome://extensions`
- check developer mode is turned on
- select `load unpacked extension`
- select the `/extension` folder in this repo.
## Identity Server
The identity server stores all of your keypairs. The api can be found in [api](/api/.README.md)
### Starting the server
```
yarn start
```
## Test Website
Included in this repo is a mock website to exhibit Socurity's functionality and facilitate development.
### Starting the mock site
```
yarn serve -l 8080 test
```

81
api/README.md 100644
View File

@ -0,0 +1,81 @@
# Identity API
The root endpoint for the server is `/api` on port 6565. For a local machine that looks like `http://localhost:6565/api`
The use of HTTP here, is potentially concerning, however, SSL complications with localhost are the main bottleneck. As a precaution, the server will only accept connection from localhost (127.0.0.1). This should limit the range of potential attacks to malware already present on the machine. at which point, your keypairs are already at risk.
# Endpoints
## `GET` - `/identity` alias `/identities`
List all identities (an object keyed by the identity's Identifier, with friendly names as the values.)
### `200`
```json
{
"identities": {
"m3bpZMBdp5uea4r7": "Default"
}
}
```
## `GET` - `/identity/:uid`
Retrieve data about a particular Identity with a given `uid`.
### `200`
```json
{
"name": "Default",
"public": "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAlulSpSeS1vAjUwXgcSlj+J6ncHScwujPYMWi8cza5IfdI5Od2g4A\nlk48mOQXkQFeiftc2YEn298NnzVQIEjGZIgCH+59VGN8aCNvHosbgXxcUnivAjKl\ny5Kk7M9Q8+rh01nd0Vv+xv5yFVSDKbtfB6pSeGsFEfy2r1rieBCg6pno5Dib+8EQ\nA9zcrb+zlolOL8c/YSx+JXiT5LKd/7Vu4Pkw85kyMtfmxu/nujepqnjJPkYTAa6Q\nYGFdGubST6Kb7OGZlT23xJ0WAn26oYQZ93wCQAxWIchvSTAzaGSkqiXtZf3gxIEz\nqGads0PMIJcGvtX4Kbggfy354w1vhTRlJQIDAQAB\n-----END RSA PUBLIC KEY-----",
"_id":"m3bpZMBdp5uea4r7"
}
```
## `POST` - `/encrypt/:uid`
Encrypt a string using the private key of a particular Identity with a given `uid`.
### `POST` Parameters
```
Content-Type: application/json
```
```json
{
"data": "My String to Encrypt"
}
```
### `200`
```json
{
"data": "someBase64ContentWithoutAnyPrefixOrSuffix"
}
```
## `POST` - `/decrypt/:uid`
Decrypt a string using the public key of a particular Identity with a given `uid`.
### `POST` Parameters
```
Content-Type: application/json
```
```json
{
"data": "someBase64ContentWithoutAnyPrefixOrSuffix"
}
```
### `200`
```json
{
"data": "My Original String"
}
```

View File

@ -5,7 +5,8 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"serve": "serve" "serve": "serve",
"start": "node index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",