Commit f382cce4 authored by Frauke's avatar Frauke
Browse files

Updated Readme

parent 1d22dc30
......@@ -33,6 +33,31 @@ For more information on this spike visit the [Indienet documentation](https://in
## Notes
When you run 'npm start' two servers will be set up. One on port 8080 and one on port 8181.
First page you have to visit on both servers is **/register**
On this page you can fill in a domain name and password.
When you submit the form, following keys will be generated and saved to the server:
* Public key for encyption
* Private key for signing
(In later spikes we will use 1 key for both signing and encrypting)
You will be redirected to the sign-in page.
On the **/sign-in** you can fill in the same password as on the register page.
When you submit the form, the JWT will be created and saved in a cookie.
You will be redirected to the index page.
On the **/index** page you can find the logout button. When you click the button, the indexedDB and cookies will be cleared.
When you're logged in, you can visit **/hello** and you will see the hello text on the screen.
When you're not logged in and you visit **/hello**, you will be redirected to sign in page.
**SENDING MESSAGES:**
If you like to test the messaging, you have to send a message from server 1 (8080) to server 2 (8181).
You fill in a message and click the 'send message' button.
Afterwards you go to server 2 and click the receive message button. You're message will appear in the console.
*client code is the same for server 1 and 2, URLS for private and public keys are hardcoded.*
## Changelog
......
This diff is collapsed.
......@@ -4,11 +4,10 @@
"description": "Explore sending end-to-end encrypted messages",
"main": "./server/server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon ./server/server.js",
"start": "node ./server/server.js",
"watch2": "nodemon ./server2/server.js",
"start2": "node ./server2/server.js"
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec npm test",
"watch": "nodemon",
"start": "gulp js:bundle | node ./server/server.js | node ./server2/server.js"
},
"repository": {
"type": "git",
......@@ -19,6 +18,7 @@
"devDependencies": {
"browserify": "^15.1.0",
"event-stream": "^3.3.4",
"expect": "^22.1.0",
"glob": "^7.1.2",
"gulp": "^3.9.1",
"gulp-rename": "^1.2.2",
......
......@@ -140,4 +140,5 @@ app.get('/nonce', (req, res) => {
})
})
console.log('Server 1 started on port 8080')
app.listen(8080)
{"salt":"bb5dd30dd79dfe77673facbac9ebb248","privateKey":"-----BEGIN ENCRYPTED PRIVATE KE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cb1eLQkga6o2GP+JgYLVTXGvQC39LoYLNNJWpP81J\r\n3ftqI0gnEkLvYCUM9yVCwzzpTBX+arq4qLCKsibtM+B9f6i6oHMa+sPbQWwFrpaI\r\nt29H4u++5YHJpDAK5DO4EzDOUAUFVFD31/A9lz/EcLzXe0FFboGVIFRjrvEcG2J5\r\nGT7I6ARjdjBFTBjz5p3xuWIUhx0N/y7d58Ud5BAOzT3S/lXP9K30xN0eWebbXeSs\r\n9wIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
0ZF8DCe15IENOkhfwVMy4kpg+OYSxzTpw0WSGWZJ99Cco1VzP82MwaHDIqdJofv0
\ No newline at end of file
F1FNhJJgYT0PuTzSDVaCQCZJjlbFXxgdRtKwR9pMc6e/z0ThzDhSsmVwWBWK/Y4EkSyehN7Dbu6zXzsS8AUC8zGP96KYEVMeaNChbFogCQRpvP3OSw9zFEM5WtQyafUzdVrHcIxq5Wb1oLiD351p5usfHaJxlWig8b4ecNYQ4z2ReYSPMp0wXlxo6GDVvd2kSkWA6ESFVFEGakrNYUOurSbg/MSlQUV6Ft6o/p+OzkKEMV4MZVqomHsHJzQobw6WaWGiYSg2wWpKfVWGmOzuZ3DHqo+0CkRzTcNeo/DiwOUTf5BwL3PTEAVZ53quQHJxlIZn4TPqdrEEc5dEo8sfrQ==
\ No newline at end of file
{"salt":"bb5dd30dd79dfe77673facbac9ebb248","privateKey":"-----BEGIN ENCRYPTED PRIVATE KEY-----\r\nMIIFNTBfBgkqhkiG9w0BBQ0wUjAxBgkqhkiG9w0BBQwwJAQQjUzoE9f7UbJkCr6m\r\nXwL8wQIC+gAwDAYIKoZIhvcNAgsFADAdBglghkgBZQMEASoEEMwANwyu3gOvaW6/\r\nx73l39IEggTQjO+1zKyeYwQ2cuBirCNsjxdmkYPhAZKgwFjIY9ZbTpWULhbt9yGQ\r\nyGtryWqTc5RfwFimzzcq5xsBKcES2CU5F9Wjmf8qQoBUbESN7MjYLsj0M7ft0Tnp\r\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V1gw3gpqTd\r\n7EqXaONqE5/SiCLwvVYM+f0DA8lpo8tNtpxZUCJfCV9HFj+UuIr+eToj+dSgdCTb\r\nxSOEfgwRhidMc8h3lrPvy96nWpAC7H5kzSQTNEbE1KtL0EERQpMungIJBHvPs5Ej\r\nX+8B/R47Ax1h89XYMHazhnAsfHJJOnO0GjuaDIcy7OkfQ3HvAjLu2/bh4HH5VgPm\r\nVc/juoQi2TUDlxaGw4oR3oWPPMX94x9r5I5ciEk/vPoBAmb9zVitd47/vPrBugVp\r\n/vUaHKfQI22DdIF+r1GcD19Sfn2Fom5AedGsXiLppCcnUdS4YE5wVCwPT/A7cTxF\r\nHv6VewwhsxlUK7KD8hIC8xqg30+X1CGx2/8HjyJw2OiRXhDvpuOG9XsE3JAXD+PG\r\n2PAvbzs6xZK2oLMq7SxdO2LbsZBBaKKjgZkgTSE6uIBadQE8NDxpP21t8y+tEWZY\r\n7MQsYxytkQOWV5MC3E5kWiKN4s1ATgdBcYK4j7YP2eQawsJht2QVvB0=\r\n-----END ENCRYPTED PRIVATE KEY-----"}
\ No newline at end of file
{"publicKey":"-----BEGIN PUBLIC KEY-----\r\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1urQrcK0qFW6vQessNmD\r\nzwFH2l8mUaHbmNWkKx8PohSTFwqfSYyogmRXcfxzxMzN4hr8GH/u/AUik5KjdGg7\r\nDB5xC/yChXta5KItGeIF6o7fe1im8AbkHY/i9EGrxcw6l8954dm2rZTq/U0te5+9\r\npSR9su9ZQpRmdmx7/1r0Hpc/358V5Wl/fki2AJ6mVXgeHMoCPPZHTs5envDbOYXY\r\nVdhwX+G5m2/vG4pwpMdYHv8Xja2tbngBrkyn6DoPvHSRgARosXZlJGXKMviJO6h1\r\nHOHenGwOOTx2n4I0Y+7AFIVoeWOrJwNg/p6Sij7K4N0ZPIpQcBeyAQ2lSLstJJFb\r\nKQIDAQAB\r\n-----END PUBLIC KEY-----"}
\ No newline at end of file
......@@ -169,4 +169,5 @@ app.get('/listmessages', (req, res) => {
})
})
console.log('Server 2 started on port 8181')
app.listen(8181)
......@@ -34,8 +34,6 @@ sendForm.addEventListener('submit', (e) => {
return crypt.pemPublicToCrypto(values[1].data.publicKey)
}).then((publicKeyOther) => {
crypt.encryptKey(publicKeyOther, secretSessionKey).then((encryptedSessionKey) => {
console.log('sessionkey', encryptedSessionKey)
console.log('encryptedMessage', encryptedMessage)
const data = {
sessionKey: encryptedSessionKey,
message: encryptedMessage
......
......@@ -64,6 +64,7 @@ form.addEventListener('submit', (e) => {
id: 'sign',
keys: values[1]
})
window.location = 'sign-in'
})
}).catch((err) => {
console.log(err)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment