├── server.log
├── PGP-Chat-Server
├── chat
│ ├── js
│ │ ├── client
│ │ │ ├── crypt.js
│ │ │ └── Server-Schnittstelle.js
│ │ ├── isarray.js
│ │ ├── RSAMessageFormatBitPadding.js
│ │ ├── RSAMessageFormatSOAEP.js
│ │ ├── RSAMessageFormatSOAEP_DIRECT.js
│ │ ├── trace.js
│ │ ├── base64.js
│ │ ├── elapse.js
│ │ ├── PGdecode.htm
│ │ ├── BitPadding.js
│ │ ├── packages.js
│ │ ├── jquery.json2html.js
│ │ ├── RSAKeyFormat.js
│ │ ├── mouse.js
│ │ ├── SecureRandom.js
│ │ ├── PGpubkey.js
│ │ ├── sha1.js
│ │ ├── SOAEP.js
│ │ └── PGencode.js
│ ├── html
│ │ ├── index.html
│ │ ├── index.html~
│ │ ├── jabberClient.html~
│ │ ├── rsakeygenerieren.html
│ │ ├── rsakeygenerieren.html~
│ │ ├── accountErstellen.html
│ │ └── accountErstellen.html~
│ ├── rsakeygenerieren.html
│ └── accountErstellen.html
├── README
├── README.md
├── message.js
├── start.js
├── tlsserver.js
├── constants.js
├── router.js
├── npm-debug.log
├── sslKeys
│ ├── certrequest.csr
│ ├── certificate.pem
│ └── privatekey.pem
├── fileSystem.js
├── server.js
├── requestHandlers.js
├── nowchat.js
└── chat.js
├── README
├── Dokumentation
├── Doku.pdf
├── Bilder
│ ├── Nachrichtempfangen.png
│ ├── Nachrichtversenden.png
│ ├── BenutzerRegistrieren.png
│ └── ServerKlassendiagramm.png
└── Abstract
└── Vortrag_PEP-chat
├── .gitignore
├── img
├── pgp.png
├── intro.jpg
├── ihearyou.jpg
├── thankyou.png
├── Chat-Verlauf.png
├── Datenbank-Users.png
├── nachrichtSenden.png
├── Datenbank-Messages.png
├── nachrichtEmpfangen.png
├── SymmetrischeVerschluesselung.png
└── AsymmetrischeVerschluesselung.png
├── .travis.yml
├── lib
├── font
│ ├── league_gothic_license
│ ├── league_gothic-webfont.eot
│ ├── league_gothic-webfont.ttf
│ └── league_gothic-webfont.woff
├── js
│ ├── html5shiv.js
│ ├── classList.js
│ └── head.min.js
└── css
│ └── zenburn.css
├── plugin
├── markdown
│ ├── example.md
│ ├── example.html
│ └── markdown.js
├── print-pdf
│ └── print-pdf.js
├── postmessage
│ ├── postmessage.js
│ └── example.html
├── remotes
│ └── remotes.js
├── notes-server
│ ├── client.js
│ ├── index.js
│ └── notes.html
└── notes
│ ├── notes.js
│ └── notes.html
├── package.json
├── css
├── theme
│ ├── template
│ │ ├── settings.scss
│ │ ├── mixins.scss
│ │ └── theme.scss
│ ├── source
│ │ ├── uulm.scss
│ │ ├── night.scss
│ │ ├── serif.scss
│ │ ├── sky.scss
│ │ ├── simple.scss
│ │ ├── cccs.scss
│ │ ├── default.scss
│ │ ├── beige.scss
│ │ └── uulm-base.scss
│ ├── README.md
│ ├── uulm.css
│ ├── night.css
│ ├── serif.css
│ ├── simple.css
│ ├── sky.css
│ ├── beige.css
│ ├── default.css
│ ├── uulm-base.css
│ └── cccs.css
└── print
│ ├── pdf.css
│ └── paper.css
├── LICENSE
└── Gruntfile.js
/server.log:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/client/crypt.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/README:
--------------------------------------------------------------------------------
1 | just some testing...
2 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/README.md:
--------------------------------------------------------------------------------
1 | PGP-Chat
2 | ========
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/client/Server-Schnittstelle.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | Praxisbeispiel zum Thema Sicherheit in Verteilten Systemen
--------------------------------------------------------------------------------
/Dokumentation/Doku.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Dokumentation/Doku.pdf
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .svn
3 | log/*.log
4 | tmp/**
5 | node_modules/
6 | .sass-cache
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/pgp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/pgp.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/intro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/intro.jpg
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/ihearyou.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/ihearyou.jpg
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/thankyou.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/thankyou.png
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/index.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/html/index.html
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | node_js:
3 | - 0.8
4 | before_script:
5 | - npm install -g grunt-cli
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/index.html~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/html/index.html~
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/Chat-Verlauf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/Chat-Verlauf.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/Datenbank-Users.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/Datenbank-Users.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/nachrichtSenden.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/nachrichtSenden.png
--------------------------------------------------------------------------------
/Dokumentation/Bilder/Nachrichtempfangen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Dokumentation/Bilder/Nachrichtempfangen.png
--------------------------------------------------------------------------------
/Dokumentation/Bilder/Nachrichtversenden.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Dokumentation/Bilder/Nachrichtversenden.png
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/rsakeygenerieren.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/rsakeygenerieren.html
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/Datenbank-Messages.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/Datenbank-Messages.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/nachrichtEmpfangen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/nachrichtEmpfangen.png
--------------------------------------------------------------------------------
/Dokumentation/Bilder/BenutzerRegistrieren.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Dokumentation/Bilder/BenutzerRegistrieren.png
--------------------------------------------------------------------------------
/Dokumentation/Bilder/ServerKlassendiagramm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Dokumentation/Bilder/ServerKlassendiagramm.png
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/jabberClient.html~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/html/jabberClient.html~
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/rsakeygenerieren.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/html/rsakeygenerieren.html
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/rsakeygenerieren.html~:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/PGP-Chat-Server/chat/html/rsakeygenerieren.html~
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/font/league_gothic_license:
--------------------------------------------------------------------------------
1 | SIL Open Font License (OFL)
2 | http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL
3 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/font/league_gothic-webfont.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/lib/font/league_gothic-webfont.eot
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/font/league_gothic-webfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/lib/font/league_gothic-webfont.ttf
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/SymmetrischeVerschluesselung.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/SymmetrischeVerschluesselung.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/font/league_gothic-webfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/lib/font/league_gothic-webfont.woff
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/img/AsymmetrischeVerschluesselung.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cccs/PGP-Chat/master/Vortrag_PEP-chat/img/AsymmetrischeVerschluesselung.png
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/js/html5shiv.js:
--------------------------------------------------------------------------------
1 | document.createElement('header');
2 | document.createElement('nav');
3 | document.createElement('section');
4 | document.createElement('article');
5 | document.createElement('aside');
6 | document.createElement('footer');
7 | document.createElement('hgroup');
--------------------------------------------------------------------------------
/PGP-Chat-Server/message.js:
--------------------------------------------------------------------------------
1 | /*
2 | TODO:
3 | hier die Klasse Message implementieren.
4 | Diese soll alle Daten zu einer Message speichern ( Author, Receiver, Zeitpunkt, Nachrichten-ID bzw. Number)
5 | */
6 |
7 | function init(){
8 | return {
9 |
10 | };
11 | }
12 |
13 | exports.init = init;
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/markdown/example.md:
--------------------------------------------------------------------------------
1 | # Markdown Demo
2 |
3 |
4 |
5 | ## External 1.1
6 |
7 | Content 1.1
8 |
9 |
10 | ## External 1.2
11 |
12 | Content 1.2
13 |
14 |
15 |
16 | ## External 2
17 |
18 | Content 2.1
19 |
20 |
21 |
22 | ## External 3.1
23 |
24 | Content 3.1
25 |
26 |
27 | ## External 3.2
28 |
29 | Content 3.2
30 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/isarray.js:
--------------------------------------------------------------------------------
1 | /*
2 | * isarray.js
3 | *
4 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
5 | * This script file is distributed under the LGPL
6 | */
7 | var packageRoot = this;
8 | if ( packageRoot.__PACKAGE_ENABLED ) {
9 | __unit("isarray.js");
10 | __uses("packages.js");
11 | }
12 | Array.prototype.isArray=true;
13 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/start.js:
--------------------------------------------------------------------------------
1 | var server = require("./server");
2 | var router = require("./router");
3 | var requestHandlers = require("./requestHandlers");
4 |
5 | var handle = {}
6 | handle["/"] = requestHandlers.start;
7 | handle["/js/"] = requestHandlers.javascriptFile;
8 | handle["/register/"] = requestHandlers.registerUser;
9 |
10 | server.start(router.route, handle);
11 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/tlsserver.js:
--------------------------------------------------------------------------------
1 | var tls = require('https');
2 | var fs = require('fs');
3 |
4 | var runningDirectory = "/home/andreas/PGP-Chat/PGP-Chat-Server/";
5 |
6 | var options = {
7 | key: fs.readFileSync(runningDirectory+'sslKeys/privatekey.pem'),
8 | cert: fs.readFileSync(runningDirectory+'sslKeys/certificate.pem')
9 | };
10 |
11 | tls.createServer(options, function (req, res) {
12 |
13 | res.writeHead(200);
14 | res.end("welcome!\n");
15 | }).listen(8000);
16 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/constants.js:
--------------------------------------------------------------------------------
1 |
2 | exports.REGISTER_USER_FIELDNAME_USERNAME = "username";
3 | exports.REGISTER_USER_FIELDNAME_PRIVATE_KEY = "privateKey";
4 | exports.REGISTER_USER_FIELDNAME_PUBLIC_KEY = "publicKey";
5 | exports.REGISTER_USER_FIELDNAME_PASSWORD = "key_password";
6 |
7 | exports.DATABASE_NAME = "pgpchat";
8 | exports.DATABASE_USER_NAME = "pgpchatuser";
9 | exports.DATABASE_USER_PASSWORD = "pgpchatuserpw";
10 |
11 | exports.DATABASE_TABLE_USERS_NAME = "users";
12 | exports.DATABASE_TABLE_USERS_NAME_MAXLEN = 30;
13 |
14 | exports.DATABASE_TABLE_SESSIONS_SESSIONID_MAXLEN = 49;
15 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/router.js:
--------------------------------------------------------------------------------
1 | var url = require("url");
2 | var fs = require("./fileSystem.js");
3 |
4 | function route(handle, request, response) {
5 | var pathname = fs.getPathFrom(url.parse(request.url).pathname);
6 |
7 | console.log("About to route a request for " + pathname);
8 | if (typeof handle[pathname] === 'function') {
9 | handle[pathname](request, response);
10 | } else {
11 | console.log("No request handler found for " + pathname);
12 | response.writeHead(404, {"Content-Type": "text/plain"});
13 | response.write("404 Not found");
14 | response.end();
15 | }
16 | }
17 |
18 | exports.route = route;
19 |
--------------------------------------------------------------------------------
/Dokumentation/Abstract:
--------------------------------------------------------------------------------
1 | Die Kommunikation über das Internet mittels Textnachrichten ist dank Facebook, WhattsApp und Co. kostenlos und kinderleicht. Eine sichere Kommunikation sowie ausreichender Schutz der privaten Daten des Benutzers ist bei diesen Anbietern allerdings nicht immer garantiert. Außerdem ist oft unklar inwieweit die privaten Daten der Benutzer an dritte weitergegeben werden (beispielsweise für Werbezwecke).
2 | Entsprechenden Schutz bieten diverse andere Anwendungen und Protokolle, welche Nachrichten nur verschlüsselt übertragen. Deren Bedienung und Einrichtung ist jedoch komplizierter und aufwendiger als bei den zuvor erwähnten Chatprogrammen.
3 | Der Vortrag befasst sich mit der Idee, Konzeption und Umsetzung einer Chat-Webanwendung, welche die beiden vorgestellten Aspekte - einfache Bedienung + Schutz durch Ende-zu-Ende verschlüsselter Kommunikation - vereinen soll.
4 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "reveal.js",
3 | "version": "2.3.0",
4 | "description": "The HTML Presentation Framework",
5 | "homepage": "http://lab.hakim.se/reveal-js",
6 | "author": {
7 | "name": "Hakim El Hattab",
8 | "email": "hakim.elhattab@gmail.com",
9 | "web": "http://hakim.se"
10 | },
11 | "repository": {
12 | "type": "git",
13 | "url": "git://github.com/hakimel/reveal.js.git"
14 | },
15 | "engines": {
16 | "node": "~0.8.0"
17 | },
18 | "scripts": {
19 | "test": "grunt jshint"
20 | },
21 | "dependencies": {
22 | "underscore": "~1.3.3",
23 | "express": "~2.5.9",
24 | "socket.io": "~0.9.6",
25 | "mustache": "~0.4.0"
26 | },
27 | "devDependencies": {
28 | "grunt-contrib-jshint": "~0.2.0",
29 | "grunt-contrib-cssmin": "~0.4.1",
30 | "grunt-contrib-uglify": "~0.1.1",
31 | "grunt-contrib-watch": "~0.2.0",
32 | "grunt": "~0.4.0"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/npm-debug.log:
--------------------------------------------------------------------------------
1 | 0 info it worked if it ends with ok
2 | 1 verbose cli [ 'nodejs', '/usr/bin/npm', 'install', '-r', 'express' ]
3 | 2 warn invalid config registry="express"
4 | 3 warn invalid config Must be a full url with 'http://'
5 | 4 info using npm@1.2.12
6 | 5 info using node@v0.8.21
7 | 6 verbose read json /home/andreas/package.json
8 | 7 error install Couldn't read dependencies
9 | 8 error Error: ENOENT, open '/home/andreas/package.json'
10 | 9 error If you need help, you may report this log at:
11 | 9 error
12 | 9 error or email it to:
13 | 9 error
14 | 10 error System Linux 2.6.32-042stab057.1
15 | 11 error command "nodejs" "/usr/bin/npm" "install" "-r" "express"
16 | 12 error cwd /home/andreas/PGP-Chat/PGP-Chat-Server
17 | 13 error node -v v0.8.21
18 | 14 error npm -v 1.2.12
19 | 15 error path /home/andreas/package.json
20 | 16 error code ENOENT
21 | 17 error errno 34
22 | 18 verbose exit [ 34, true ]
23 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/print-pdf/print-pdf.js:
--------------------------------------------------------------------------------
1 | /**
2 | * phantomjs script for printing presentations to PDF.
3 | *
4 | * Example:
5 | * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf
6 | *
7 | * By Manuel Bieh (https://github.com/manuelbieh)
8 | */
9 |
10 | // html2pdf.js
11 | var page = new WebPage();
12 | var system = require( 'system' );
13 |
14 | page.paperSize = {
15 | format: 'A4',
16 | orientation: 'landscape',
17 | margin: {
18 | left: '0',
19 | right: '0',
20 | top: '0',
21 | bottom: '0'
22 | }
23 | };
24 | page.zoomFactor = 1.5;
25 |
26 | var revealFile = system.args[1] || 'index.html?print-pdf';
27 | var slideFile = system.args[2] || 'slides.pdf';
28 |
29 | if( slideFile.match( /\.pdf$/gi ) === null ) {
30 | slideFile += '.pdf';
31 | }
32 |
33 | console.log( 'Printing PDF...' );
34 |
35 | page.open( revealFile, function( status ) {
36 | console.log( 'Printed succesfully' );
37 | page.render( slideFile );
38 | phantom.exit();
39 | } );
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/template/settings.scss:
--------------------------------------------------------------------------------
1 | // Base settings for all themes that can optionally be
2 | // overridden by the super-theme
3 |
4 | // Background of the presentation
5 | $backgroundColor: #2b2b2b;
6 |
7 | // Primary/body text
8 | $mainFont: 'Lato', Times, 'Times New Roman', serif;
9 | $mainFontSize: 36px;
10 | $mainColor: #eee;
11 |
12 | // Headings
13 | $headingFont: 'League Gothic', Impact, sans-serif;
14 | $headingColor: #eee;
15 | $headingLineHeight: 0.9em;
16 | $headingLetterSpacing: 0.02em;
17 | $headingTextTransform: uppercase;
18 | $headingTextShadow: 0px 0px 6px rgba(0,0,0,0.2);
19 | $heading1TextShadow: $headingTextShadow;
20 |
21 | // Links and actions
22 | $linkColor: #13DAEC;
23 | $linkColorHover: lighten( $linkColor, 20% );
24 |
25 | // Text selection
26 | $selectionBackgroundColor: #FF5E99;
27 | $selectionColor: #fff;
28 |
29 | // Generates the presentation background, can be overridden
30 | // to return a background image or gradient
31 | @mixin bodyBackground() {
32 | background: $backgroundColor;
33 | }
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/uulm.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * UUlm theme for reveal.js.
3 | *
4 | */
5 |
6 |
7 | // Default mixins and settings -----------------
8 | @import "../template/mixins";
9 | @import "../template/settings";
10 | // ---------------------------------------------
11 |
12 |
13 | // Include theme-specific fonts
14 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
15 |
16 | $highlightColor: #a32638;
17 |
18 | // Override theme settings (see ../template/settings.scss)
19 | $mainFont: 'Open Sans', sans-serif;
20 | $mainFontSize: 30px;
21 | $mainColor: #666666;
22 | $headingFont: 'Open Sans', sans-serif;
23 | $headingColor: $highlightColor;
24 | $headingLineHeight: 36px;
25 | $headingLetterSpacing: -1px;
26 | $headingTextTransform: none;
27 | $headingTextShadow: 0 1px 1px rgba(0,0,0,0.1);
28 | $heading1TextShadow: 0 1px 1px rgba(0,0,0,0.1);
29 | $linkColor: #3b759e;
30 | $linkColorHover: lighten( $linkColor, 20% );
31 | $selectionBackgroundColor: #134674;
32 |
33 | @import "uulm-base";
34 |
35 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/accountErstellen.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Account erstellen
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
Neuen Account erstellen
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/accountErstellen.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Account erstellen
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
Neuen Account erstellen
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/sslKeys/certrequest.csr:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE REQUEST-----
2 | MIICrTCCAZUCAQAwaDELMAkGA1UEBhMCREUxCzAJBgNVBAgMAkJXMQowCAYDVQQH
3 | DAFTMQ0wCwYDVQQKDAR0ZXN0MQ0wCwYDVQQLDAR0ZXN0MQ0wCwYDVQQDDAR0ZXN0
4 | MRMwEQYJKoZIhvcNAQkBFgR0ZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB
5 | CgKCAQEAw2BQF1oLs76bZ/m7XhhTlaZzvFwmc0MDaY7Oz88cWxFg0eDpFT3BorwU
6 | Gx/39gntld7HSAS2A0EYizHXqdeQ+NQirfyRjUASUzLFibHrM7OTnMhNaivn7M/a
7 | phR3Pm1k/0NGxGKWct/XMMZY6FpSfD02aHbjo8dLCRS3YLctEv6MQKCZltz6Bzxc
8 | yQ+WWjVY0YvXf44avzt3CsAiH5Rg4AugdkJn4NLWI6WPyUbXJWxUXY8B6VW3uJNV
9 | zVFJTssFFN4+ihuUH/lZ+XREV42/ud22A6XaEYPxNUq2obSaqq0Qp9ctE78C39Ek
10 | Lfo2L9BudpWSw9eZViPhJyx7v4oGowIDAQABoAAwDQYJKoZIhvcNAQEFBQADggEB
11 | AGdnNoW8N0uDIpUi4bVDYnH5Q+1+vf9A/D1FNcmcyizbozD0T7LBwpKF1LKMBKv5
12 | BrLj8ZHSR+vmyEDaVc7TjGnGnkLKhH/NlLm1icZPl2/zj0jXZzYvqs4hDeZBTdhp
13 | K+dD9ecESFmtgIAH7nGVbzyfOIUsVy71ocues+QhTj6HJjNLDv7G2CG9fvJCofdY
14 | oLhFd4Sm09HdC+Ffa4LUweI75CDGaC9XRmOttIsLhDmTV6UKi+X/dZabiArhJBPu
15 | ifkUbQSaUcvIxL6zzEVnwaHPGzbEFlMmODJ+zbRZcxOcTjZ05VKk6DaS/beGQtlm
16 | 6RunAJE+HhlX21Ru3zfU4Zc=
17 | -----END CERTIFICATE REQUEST-----
18 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/RSAMessageFormatBitPadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | * RSAMessageFormatSOAEP.js
3 | * See RSAMessageFormatSOAEP.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 |
9 | function initMessageFormatBitPadding(packageRoot) {
10 | __unit( "RSAMessageFormatBitPadding.js" );
11 | __uses( "packages.js" );
12 | __uses( "Cipher.js" );
13 | __uses( "SecureRandom.js" );
14 | __uses( "SOAEP.js" );
15 | __uses( "RSAMessageFormat.js" );
16 |
17 | // import
18 | var BitPadding = __import( this,"titaniumcore.crypto.BitPadding" );
19 | var RSAMessageFormat = __import( this,"titaniumcore.crypto.RSAMessageFormat" );
20 |
21 | function factory(){
22 | return BitPadding.create();
23 | }
24 | var RSAMessageFormatBitPadding = new RSAMessageFormat( factory );
25 |
26 | // export
27 | __export( this,"titaniumcore.crypto.RSAMessageFormatBitPadding", RSAMessageFormatBitPadding );
28 | }
29 |
30 | initMessageFormatBitPadding( this );
31 |
32 | // vim:ts=8 sw=4:noexpandtab:
33 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright (C) 2013 Hakim El Hattab, http://hakim.se
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy
4 | of this software and associated documentation files (the "Software"), to deal
5 | in the Software without restriction, including without limitation the rights
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 | copies of the Software, and to permit persons to whom the Software is
8 | furnished to do so, subject to the following conditions:
9 |
10 | The above copyright notice and this permission notice shall be included in
11 | all copies or substantial portions of the Software.
12 |
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 | THE SOFTWARE.
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/postmessage/postmessage.js:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | simple postmessage plugin
4 |
5 | Useful when a reveal slideshow is inside an iframe.
6 | It allows to call reveal methods from outside.
7 |
8 | Example:
9 | var reveal = window.frames[0];
10 |
11 | // Reveal.prev();
12 | reveal.postMessage(JSON.stringify({method: 'prev', args: []}), '*');
13 | // Reveal.next();
14 | reveal.postMessage(JSON.stringify({method: 'next', args: []}), '*');
15 | // Reveal.slide(2, 2);
16 | reveal.postMessage(JSON.stringify({method: 'slide', args: [2,2]}), '*');
17 |
18 | Add to the slideshow:
19 |
20 | dependencies: [
21 | ...
22 | { src: 'plugin/postmessage/postmessage.js', async: true, condition: function() { return !!document.body.classList; } }
23 | ]
24 |
25 | */
26 |
27 | (function (){
28 |
29 | window.addEventListener( "message", function ( event ) {
30 | var data = JSON.parse( event.data ),
31 | method = data.method,
32 | args = data.args;
33 |
34 | if( typeof Reveal[method] === 'function' ) {
35 | Reveal[method].apply( Reveal, data.args );
36 | }
37 | }, false);
38 |
39 | }());
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/night.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Black theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 | // Include theme-specific fonts
15 | @import url(http://fonts.googleapis.com/css?family=Montserrat:700);
16 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:400,700,400italic,700italic);
17 |
18 |
19 | // Override theme settings (see ../template/settings.scss)
20 | $backgroundColor: #111;
21 |
22 | $mainFont: 'Open Sans', Times, 'Times New Roman', serif;
23 | $linkColor: #e7ad52;
24 | $linkColorHover: lighten( $linkColor, 20% );
25 | $headingFont: 'Montserrat', Impact, sans-serif;
26 | $headingTextShadow: none;
27 | $headingLetterSpacing: -0.03em;
28 | $headingTextTransform: none;
29 | $selectionBackgroundColor: #e7ad52;
30 | $mainFontSize: 30px;
31 |
32 |
33 | // Theme template ------------------------------
34 | @import "../template/theme";
35 | // ---------------------------------------------
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/html/accountErstellen.html~:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Account erstellen
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
Neuen Account erstellen
23 |
24 |
25 |
26 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/postmessage/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/remotes/remotes.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Touch-based remote controller for your presentation courtesy
3 | * of the folks at http://remotes.io
4 | */
5 |
6 | (function(window){
7 |
8 | /**
9 | * Detects if we are dealing with a touch enabled device (with some false positives)
10 | * Borrowed from modernizr: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touch.js
11 | */
12 | var hasTouch = (function(){
13 | return ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch;
14 | })();
15 |
16 | if(!hasTouch){
17 | head.ready( 'remotes.ne.min.js', function() {
18 | new Remotes("preview")
19 | .on("swipe-left", function(e){ Reveal.right(); })
20 | .on("swipe-right", function(e){ Reveal.left(); })
21 | .on("swipe-up", function(e){ Reveal.down(); })
22 | .on("swipe-down", function(e){ Reveal.up(); })
23 | .on("tap", function(e){
24 | Reveal.toggleOverview();
25 | });
26 | } );
27 |
28 | head.js('https://raw.github.com/Remotes/Remotes/master/dist/remotes.ne.min.js');
29 | }
30 | })(window);
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/serif.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is darkblue.
4 | *
5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se; so is the theme - beige.css - that this is based off of.
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Override theme settings (see ../template/settings.scss)
18 | $mainFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
19 | $mainColor: #000;
20 | $headingFont: 'Palatino Linotype', 'Book Antiqua', Palatino, FreeSerif, serif;
21 | $headingColor: #383D3D;
22 | $headingTextShadow: none;
23 | $headingTextTransform: none;
24 | $backgroundColor: #F0F1EB;
25 | $linkColor: #51483D;
26 | $linkColorHover: lighten( $linkColor, 20% );
27 | $selectionBackgroundColor: #26351C;
28 |
29 |
30 |
31 | // Theme template ------------------------------
32 | @import "../template/theme";
33 | // ---------------------------------------------
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/sky.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * Sky theme for reveal.js.
3 | *
4 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
5 | */
6 |
7 |
8 | // Default mixins and settings -----------------
9 | @import "../template/mixins";
10 | @import "../template/settings";
11 | // ---------------------------------------------
12 |
13 |
14 |
15 | // Include theme-specific fonts
16 | @import url(http://fonts.googleapis.com/css?family=Quicksand:400,700,400italic,700italic);
17 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
18 |
19 |
20 | // Override theme settings (see ../template/settings.scss)
21 | $mainFont: 'Open Sans', sans-serif;
22 | $mainColor: #333;
23 | $headingFont: 'Quicksand', sans-serif;
24 | $headingColor: #333;
25 | $headingLetterSpacing: -0.08em;
26 | $headingTextShadow: none;
27 | $backgroundColor: #f7fbfc;
28 | $linkColor: #3b759e;
29 | $linkColorHover: lighten( $linkColor, 20% );
30 | $selectionBackgroundColor: #134674;
31 |
32 | // Background generator
33 | @mixin bodyBackground() {
34 | @include radial-gradient( #add9e4, #f7fbfc );
35 | }
36 |
37 |
38 |
39 | // Theme template ------------------------------
40 | @import "../template/theme";
41 | // ---------------------------------------------
--------------------------------------------------------------------------------
/PGP-Chat-Server/sslKeys/certificate.pem:
--------------------------------------------------------------------------------
1 | -----BEGIN CERTIFICATE-----
2 | MIIDTDCCAjQCCQD9KHK0IbBMUDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJE
3 | RTELMAkGA1UECAwCQlcxCjAIBgNVBAcMAVMxDTALBgNVBAoMBHRlc3QxDTALBgNV
4 | BAsMBHRlc3QxDTALBgNVBAMMBHRlc3QxEzARBgkqhkiG9w0BCQEWBHRlc3QwHhcN
5 | MTIwOTEzMjE0NDIyWhcNMTIxMDEzMjE0NDIyWjBoMQswCQYDVQQGEwJERTELMAkG
6 | A1UECAwCQlcxCjAIBgNVBAcMAVMxDTALBgNVBAoMBHRlc3QxDTALBgNVBAsMBHRl
7 | c3QxDTALBgNVBAMMBHRlc3QxEzARBgkqhkiG9w0BCQEWBHRlc3QwggEiMA0GCSqG
8 | SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDDYFAXWguzvptn+bteGFOVpnO8XCZzQwNp
9 | js7PzxxbEWDR4OkVPcGivBQbH/f2Ce2V3sdIBLYDQRiLMdep15D41CKt/JGNQBJT
10 | MsWJseszs5OcyE1qK+fsz9qmFHc+bWT/Q0bEYpZy39cwxljoWlJ8PTZoduOjx0sJ
11 | FLdgty0S/oxAoJmW3PoHPFzJD5ZaNVjRi9d/jhq/O3cKwCIflGDgC6B2Qmfg0tYj
12 | pY/JRtclbFRdjwHpVbe4k1XNUUlOywUU3j6KG5Qf+Vn5dERXjb+53bYDpdoRg/E1
13 | SrahtJqqrRCn1y0TvwLf0SQt+jYv0G52lZLD15lWI+EnLHu/igajAgMBAAEwDQYJ
14 | KoZIhvcNAQEFBQADggEBAEgQGImWWEseZ/3+bbDCvutQQUjBCBmA+NOg7biqQYOa
15 | tvBoG8tfI2or+EB3p7QZTYMOaQnb9MQbXqDjLEsvnIZtGZ+mo9rM25WySwjWTudd
16 | nvWBixpF7OWbYw+DK+/hBdQkGYmByLURUM8Dhe66slL6VRHCg92dCM3uu0pR6WIv
17 | qXhwLayv2FlmuOFz2QF4KBmu5lqGhuUvNPeD9jVdDsDDuJFAPEuAxXpcx78rkC1t
18 | sAPSh11g108hpLjqkUzQdtvvn5GzfkwsoIuedk8nnnBhSM8ZeBWpSAMOjndwburG
19 | 7w+nvod7b+tEh+OtAthIJ+Nhjv8zWlV1eOVuUj8unb8=
20 | -----END CERTIFICATE-----
21 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/RSAMessageFormatSOAEP.js:
--------------------------------------------------------------------------------
1 | /*
2 | * RSAMessageFormatSOAEP.js
3 | * See RSAMessageFormatSOAEP.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 |
9 | function initMessageFormatSOAEP(packageRoot) {
10 | __unit( "RSAMessageFormatSOAEP.js" );
11 | __uses( "packages.js" );
12 | __uses( "Cipher.js" );
13 | __uses( "SecureRandom.js" );
14 | __uses( "SOAEP.js" );
15 | __uses( "RSAMessageFormat.js" );
16 |
17 | // import
18 | var SOAEP = __import( this,"titaniumcore.crypto.SOAEP" );
19 | var Cipher = __import( this,"titaniumcore.crypto.Cipher" );
20 | var SecureRandom = __import( this,"titaniumcore.crypto.SecureRandom" );
21 | var RSAMessageFormat = __import( this,"titaniumcore.crypto.RSAMessageFormat" );
22 |
23 | function factory(){
24 | var random = new SecureRandom();
25 | var cipherAlgorithm = Cipher.algorithm( Cipher.TWOFISH );
26 | return SOAEP.create( random, cipherAlgorithm );
27 | }
28 |
29 | var RSAMessageFormatSOAEP = new RSAMessageFormat( factory );
30 |
31 | // export
32 | __export( this,"titaniumcore.crypto.RSAMessageFormatSOAEP", RSAMessageFormatSOAEP );
33 | }
34 |
35 | initMessageFormatSOAEP( this );
36 |
37 | // vim:ts=8 sw=4:noexpandtab:
38 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/simple.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * A simple theme for reveal.js presentations, similar
3 | * to the default theme. The accent color is darkblue.
4 | *
5 | * This theme is Copyright (C) 2012 Owen Versteeg, https://github.com/StereotypicalApps. It is MIT licensed.
6 | * reveal.js is Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
7 | */
8 |
9 |
10 | // Default mixins and settings -----------------
11 | @import "../template/mixins";
12 | @import "../template/settings";
13 | // ---------------------------------------------
14 |
15 |
16 |
17 | // Include theme-specific fonts
18 | @import url(http://fonts.googleapis.com/css?family=News+Cycle:400,700);
19 | @import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
20 |
21 |
22 | // Override theme settings (see ../template/settings.scss)
23 | $mainFont: 'Lato', Times, 'Times New Roman', serif;
24 | $mainColor: #000;
25 | $headingFont: 'News Cycle', Impact, sans-serif;
26 | $headingColor: #000;
27 | $headingTextShadow: none;
28 | $headingTextTransform: none;
29 | $backgroundColor: #fff;
30 | $linkColor: #00008B;
31 | $linkColorHover: lighten( $linkColor, 20% );
32 | $selectionBackgroundColor: rgba(0, 0, 0, 0.99);
33 |
34 |
35 |
36 | // Theme template ------------------------------
37 | @import "../template/theme";
38 | // ---------------------------------------------
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/RSAMessageFormatSOAEP_DIRECT.js:
--------------------------------------------------------------------------------
1 | /*
2 | * RSAMessageFormatSOAEP.js
3 | * See RSAMessageFormatSOAEP.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 |
9 | function initMessageFormatSOAEP(packageRoot) {
10 | __unit( "RSAMessageFormatSOAEP_DIRECT.js" );
11 | __uses( "packages.js" );
12 | __uses( "Cipher.js" );
13 | __uses( "SecureRandom.js" );
14 | __uses( "SOAEP.js" );
15 | __uses( "RSAMessageFormat.js" );
16 |
17 | // import
18 | var SOAEP = __import( this,"titaniumcore.crypto.SOAEP" );
19 | var Cipher = __import( this,"titaniumcore.crypto.Cipher" );
20 | var SecureRandom = __import( this,"titaniumcore.crypto.SecureRandom" );
21 | var RSAMessageFormat = __import( this,"titaniumcore.crypto.RSAMessageFormat" );
22 |
23 | function factory(){
24 | var random = new SecureRandom();
25 | var cipherAlgorithm = Cipher.algorithm( Cipher.TWOFISH );
26 | return SOAEP.create( random, cipherAlgorithm, false );
27 | }
28 |
29 | var RSAMessageFormatSOAEP = new RSAMessageFormat( factory );
30 |
31 | // export
32 | __export( this,"titaniumcore.crypto.RSAMessageFormatSOAEP_DIRECT", RSAMessageFormatSOAEP );
33 | }
34 |
35 | initMessageFormatSOAEP( this );
36 |
37 | // vim:ts=8 sw=4:noexpandtab:
38 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/cccs.scss:
--------------------------------------------------------------------------------
1 | /**
2 | * CCCS theme for reveal.js.
3 | *
4 | */
5 |
6 |
7 | // Default mixins and settings -----------------
8 | @import "../template/mixins";
9 | @import "../template/settings";
10 | // ---------------------------------------------
11 |
12 |
13 | // Include theme-specific fonts
14 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);
15 | @import url('http://fonts.googleapis.com/css?family=Titillium+Web:200');
16 |
17 | $highlightColor: #5bc72b;
18 |
19 | // Override theme settings (see ../template/settings.scss)
20 | $mainFont: 'Open Sans', sans-serif;
21 | $mainFontSize: 30px;
22 | $mainColor: #666666;
23 | $headingFont: 'Titillium Web', sans-serif;
24 | $headingColor: $highlightColor;
25 | $headingLineHeight: 36px;
26 | $headingLetterSpacing: -1px;
27 | $headingTextTransform: none;
28 | $headingTextShadow: 0 1px 1px rgba(0,0,0,0.1);
29 | $heading1TextShadow: 0 1px 1px rgba(0,0,0,0.1);
30 | $linkColor: #061e35;
31 | $linkColorHover: lighten( $linkColor, 20% );
32 | $selectionBackgroundColor: #134674;
33 |
34 | @import "uulm-base";
35 |
36 | .reveal .slides .darkbg {
37 | color: white;
38 | text-shadow: 0 1px 1px rgba(0,0,0,0.5);
39 | a {
40 | color: white;
41 | background: rgba(255,255,255,0.2);
42 | }
43 | a:hover {
44 | color: $linkColorHover;
45 | background: rgba(255,255,255,0.7);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/fileSystem.js:
--------------------------------------------------------------------------------
1 | var fs=require('fs');
2 | var path = require('path');
3 |
4 | var runningDirectory = "/home/andreas/PGP-Chat/PGP-Chat-Server/";
5 | var javascriptDirectory = runningDirectory+"chat/js/";
6 | var htmlDirectory = runningDirectory+"chat/html/";
7 |
8 |
9 | function getHTMLFile(name, callback){
10 | var fileName=htmlDirectory+getFilenameFrom(name);
11 | callback(getFileContent(fileName));
12 | }
13 |
14 | function getJavascriptFile(name, callback){
15 | var fileName=javascriptDirectory+path.normalize(name).replace(/^js\//,'').replace(/^\/js\//,'');
16 | callback(getFileContent(fileName));
17 | }
18 |
19 | function getFilenameFrom(path){
20 | var Ausdruck = /([^\/]*)$/;
21 | Ausdruck.exec(path);
22 | return RegExp.$1;
23 | }
24 |
25 | function getPathFrom(path){
26 | var Ausdruck = /(.*\/)([^\/]*)$/;
27 | Ausdruck.exec(path);
28 | return RegExp.$1;
29 | }
30 |
31 | exports.getJavascriptFile = getJavascriptFile;
32 | exports.getHTMLFile = getHTMLFile;
33 | exports.getFilenameFrom=getFilenameFrom;
34 | exports.getPathFrom=getPathFrom;
35 |
36 | //Hilfsfunktionen:
37 |
38 | function getFileContent(fileName){
39 | console.log("Getting file:"+fileName+"\n");
40 | //fs.existsSync(fileName , function (exist) { //hier gibts nen Fehler "Type Error"
41 | if(fs.existsSync(fileName) && fs.lstatSync(fileName).isFile()){
42 | return fs.readFileSync(fileName, 'utf8');
43 | }else{
44 | return "";
45 | }
46 | //});
47 | }
48 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/js/classList.js:
--------------------------------------------------------------------------------
1 | /*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js*/
2 | if(typeof document!=="undefined"&&!("classList" in document.createElement("a"))){(function(j){var a="classList",f="prototype",m=(j.HTMLElement||j.Element)[f],b=Object,k=String[f].trim||function(){return this.replace(/^\s+|\s+$/g,"")},c=Array[f].indexOf||function(q){var p=0,o=this.length;for(;p (<%= grunt.template.today("yyyy-mm-dd, HH:MM") %>)\n' +
11 | ' * http://lab.hakim.se/reveal-js\n' +
12 | ' * MIT licensed\n' +
13 | ' *\n' +
14 | ' * Copyright (C) 2013 Hakim El Hattab, http://hakim.se\n' +
15 | ' */'
16 | },
17 |
18 | jshint: {
19 | files: [ 'Gruntfile.js', 'js/reveal.js' ]
20 | },
21 |
22 | // Tests will be added soon
23 | qunit: {
24 | files: [ 'test/**/*.html' ]
25 | },
26 |
27 | uglify: {
28 | options: {
29 | banner: '<%= meta.banner %>\n'
30 | },
31 | build: {
32 | src: 'js/reveal.js',
33 | dest: 'js/reveal.min.js'
34 | }
35 | },
36 |
37 | cssmin: {
38 | compress: {
39 | files: {
40 | 'css/reveal.min.css': [ 'css/reveal.css' ]
41 | }
42 | }
43 | },
44 |
45 | jshint: {
46 | options: {
47 | curly: false,
48 | eqeqeq: true,
49 | immed: true,
50 | latedef: true,
51 | newcap: true,
52 | noarg: true,
53 | sub: true,
54 | undef: true,
55 | eqnull: true,
56 | browser: true,
57 | expr: true
58 | },
59 | globals: {
60 | head: false,
61 | module: false,
62 | console: false
63 | }
64 | },
65 |
66 | watch: {
67 | files: [ 'Gruntfile.js', 'js/reveal.js', 'css/reveal.css' ],
68 | tasks: 'default'
69 | }
70 |
71 | });
72 |
73 | // Dependencies
74 | grunt.loadNpmTasks( 'grunt-contrib-jshint' );
75 | grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
76 | grunt.loadNpmTasks( 'grunt-contrib-uglify' );
77 | grunt.loadNpmTasks( 'grunt-contrib-watch' );
78 |
79 | // Default task
80 | grunt.registerTask( 'default', [ 'jshint', 'cssmin', 'uglify' ] );
81 |
82 | };
83 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/server.js:
--------------------------------------------------------------------------------
1 | var https = require("https");
2 | var url = require("url");
3 | var fs = require('fs');
4 | var express = require('express');
5 | var app = express(); //the Express instance
6 |
7 |
8 | var now = require('./nowchat.js');
9 |
10 | const crypto = require('crypto');
11 |
12 | var runningDirectory = "/home/andreas/PGP-Chat/PGP-Chat-Server/";
13 | var privateKey = fs.readFileSync(runningDirectory+'sslKeys/privatekey.pem').toString();
14 | var certificate = fs.readFileSync(runningDirectory+'sslKeys/certificate.pem').toString();
15 |
16 | var credentials = crypto.createCredentials({key: privateKey, cert: certificate});
17 |
18 |
19 |
20 | var INDEX_FILE = "";
21 |
22 | function start(route, handle){
23 |
24 | var runningDirectory = "/home/andreas/PGP-Chat/PGP-Chat-Server/";
25 |
26 | var options = {
27 | key: fs.readFileSync(runningDirectory+'sslKeys/privatekey.pem'),
28 | cert: fs.readFileSync(runningDirectory+'sslKeys/certificate.pem')
29 | };
30 |
31 | function onRequest(request, response) {
32 | var pathname = url.parse(request.url).pathname;
33 | console.log("Request for " + pathname + " received.");
34 |
35 | route(handle, request, response);
36 | }
37 |
38 |
39 |
40 | /*
41 | POST-Handling für Registrierungsformular.
42 | Siehe: http://stackoverflow.com/questions/5710358/how-to-get-post-query-in-express-node-js
43 | */
44 | app.use(express.bodyParser());//Nötig ab Express 3.0
45 |
46 | app.post('/register/neu.php', function(req, res) {
47 | onRequest(req,res);
48 | });
49 |
50 |
51 | //Alle Files im Ordner chat veröffentlichen:
52 | app.use(express.static(__dirname + '/chat'));
53 |
54 | var server = https.createServer(options, app).listen(8080);
55 | //var server = https.createServer(onRequest).listen(8080); //without ssl for debug
56 |
57 | now.start(server);
58 | console.log("Server started\n");
59 | }
60 |
61 |
62 | exports.start = start;
63 |
64 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/notes-server/client.js:
--------------------------------------------------------------------------------
1 | (function() {
2 | // don't emit events from inside the previews themselves
3 | if ( window.location.search.match( /receiver/gi ) ) { return; }
4 |
5 | var socket = io.connect(window.location.origin);
6 | var socketId = Math.random().toString().slice(2);
7 |
8 | console.log('View slide notes at ' + window.location.origin + '/notes/' + socketId);
9 | window.open(window.location.origin + '/notes/' + socketId, 'notes-' + socketId);
10 |
11 | // Fires when a fragment is shown
12 | Reveal.addEventListener( 'fragmentshown', function( event ) {
13 | var fragmentData = {
14 | fragment : 'next',
15 | socketId : socketId
16 | };
17 | socket.emit('fragmentchanged', fragmentData);
18 | } );
19 |
20 | // Fires when a fragment is hidden
21 | Reveal.addEventListener( 'fragmenthidden', function( event ) {
22 | var fragmentData = {
23 | fragment : 'previous',
24 | socketId : socketId
25 | };
26 | socket.emit('fragmentchanged', fragmentData);
27 | } );
28 |
29 | // Fires when slide is changed
30 | Reveal.addEventListener( 'slidechanged', function( event ) {
31 | var nextindexh;
32 | var nextindexv;
33 | var slideElement = event.currentSlide;
34 |
35 | if (slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION') {
36 | nextindexh = event.indexh;
37 | nextindexv = event.indexv + 1;
38 | } else {
39 | nextindexh = event.indexh + 1;
40 | nextindexv = 0;
41 | }
42 |
43 | var notes = slideElement.querySelector('aside.notes');
44 | var slideData = {
45 | notes : notes ? notes.innerHTML : '',
46 | indexh : event.indexh,
47 | indexv : event.indexv,
48 | nextindexh : nextindexh,
49 | nextindexv : nextindexv,
50 | socketId : socketId,
51 | markdown : notes ? typeof notes.getAttribute('data-markdown') === 'string' : false
52 |
53 | };
54 |
55 | socket.emit('slidechanged', slideData);
56 | } );
57 | }());
58 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/notes-server/index.js:
--------------------------------------------------------------------------------
1 | var express = require('express');
2 | var fs = require('fs');
3 | var io = require('socket.io');
4 | var _ = require('underscore');
5 | var Mustache = require('mustache');
6 |
7 | var app = express.createServer();
8 | var staticDir = express.static;
9 |
10 | io = io.listen(app);
11 |
12 | var opts = {
13 | port : 1947,
14 | baseDir : __dirname + '/../../'
15 | };
16 |
17 | io.sockets.on('connection', function(socket) {
18 | socket.on('slidechanged', function(slideData) {
19 | socket.broadcast.emit('slidedata', slideData);
20 | });
21 | socket.on('fragmentchanged', function(fragmentData) {
22 | socket.broadcast.emit('fragmentdata', fragmentData);
23 | });
24 | });
25 |
26 | app.configure(function() {
27 | [ 'css', 'js', 'img', 'plugin', 'lib' ].forEach(function(dir) {
28 | app.use('/' + dir, staticDir(opts.baseDir + dir));
29 | });
30 | });
31 |
32 | app.get("/", function(req, res) {
33 | fs.createReadStream(opts.baseDir + '/index.html').pipe(res);
34 | });
35 |
36 | app.get("/notes/:socketId", function(req, res) {
37 |
38 | fs.readFile(opts.baseDir + 'plugin/notes-server/notes.html', function(err, data) {
39 | res.send(Mustache.to_html(data.toString(), {
40 | socketId : req.params.socketId
41 | }));
42 | });
43 | // fs.createReadStream(opts.baseDir + 'notes-server/notes.html').pipe(res);
44 | });
45 |
46 | // Actually listen
47 | app.listen(opts.port || null);
48 |
49 | var brown = '\033[33m',
50 | green = '\033[32m',
51 | reset = '\033[0m';
52 |
53 | var slidesLocation = "http://localhost" + ( opts.port ? ( ':' + opts.port ) : '' );
54 |
55 | console.log( brown + "reveal.js - Speaker Notes" + reset );
56 | console.log( "1. Open the slides at " + green + slidesLocation + reset );
57 | console.log( "2. Click on the link your JS console to go to the notes page" );
58 | console.log( "3. Advance through your slides and your notes will advance automatically" );
59 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/trace.js:
--------------------------------------------------------------------------------
1 | /*
2 | * trace.async.js
3 | * Simple debugging tool.
4 | * See trace.async.readme.txt for further information.
5 | *
6 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
7 | * This script file is distributed under the LGPL
8 | */
9 | function initTraceAsync(packageRoot) {
10 | if ( packageRoot.__PACKAGE_ENABLED ) {
11 | __unit( "trace.js" );
12 | }
13 |
14 | var proc = function() {
15 | if ( queueModified && traceWindow != null && ( ! traceWindow.closed ) ) {
16 | queueModified=false;
17 | createHTML();
18 | }
19 | };
20 | var timer = setInterval( proc, 500 );
21 | var queue = [];
22 | var queueModified = false;
23 |
24 | function createWindow(){
25 | traceWindow = window.open( "","trace", "left=0,top=0,width=500,height=300,scrollbars=yes,location=no,status=no,menubar=no" );
26 | }
27 |
28 | function createHTML(){
29 | var d = traceWindow.document ;
30 | d.open( "text/html", false );
31 | d.writeln( "" );
32 | d.writeln( "" );
33 | d.writeln( "" );
34 | d.writeln( "Trace Window" );
35 | d.writeln( "" );
36 | d.writeln( "" );
37 | d.writeln( "" );
38 | for ( var i=0; i" );
40 | }
41 | // var checked = "";
42 | // d.writeln( "" );
46 | d.writeln( "" );
47 | d.writeln( "" );
48 | d.close();
49 |
50 | traceWindow.scrollTo( 0, 2147483647 );
51 | }
52 |
53 | var traceWindow=null;
54 | function reactivate() {
55 | if ( traceWindow==null || traceWindow.closed ) {
56 | createWindow();
57 | }
58 | }
59 |
60 | function post( s ) {
61 | queue.push( s );
62 | queueModified = true;
63 | }
64 |
65 | function trace( s ) {
66 | reactivate();
67 | post(s);
68 | }
69 | packageRoot.trace = trace;
70 | }
71 | initTraceAsync(this);
72 | // vim:ts=8:
73 |
74 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/base64.js:
--------------------------------------------------------------------------------
1 |
2 | /* OpenPGP radix-64/base64 string encoding/decoding
3 | * Copyright 2005 Herbert Hanewinkel, www.haneWIN.de
4 | * version 1.0, check www.haneWIN.de for the latest version
5 |
6 | * This software is provided as-is, without express or implied warranty.
7 | * Permission to use, copy, modify, distribute or sell this software, with or
8 | * without fee, for any purpose and by any individual or organization, is hereby
9 | * granted, provided that the above copyright notice and this paragraph appear
10 | * in all copies. Distribution as a part of an application or binary must
11 | * include the above copyright notice in the documentation and/or other materials
12 | * provided with the application or distribution.
13 | */
14 |
15 | var b64s='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
16 |
17 | function s2r(t)
18 | {
19 | var a, c, n;
20 | var r='', l=0, s=0;
21 | var tl=t.length;
22 |
23 | for(n=0; n>2)&63);
29 | a=(c&3)<<4;
30 | }
31 | else if(s==1)
32 | {
33 | r+=b64s.charAt((a|(c>>4)&15));
34 | a=(c&15)<<2;
35 | }
36 | else if(s==2)
37 | {
38 | r+=b64s.charAt(a|((c>>6)&3));
39 | l+=1;
40 | if((l%60)==0) r+="\n";
41 | r+=b64s.charAt(c&63);
42 | }
43 | l+=1;
44 | if((l%60)==0) r+="\n";
45 |
46 | s+=1;
47 | if(s==3) s=0;
48 | }
49 | if(s>0)
50 | {
51 | r+=b64s.charAt(a);
52 | l+=1;
53 | if((l%60)==0) r+="\n";
54 | r+='=';
55 | l+=1;
56 | }
57 | if(s==1)
58 | {
59 | if((l%60)==0) r+="\n";
60 | r+='=';
61 | }
62 |
63 | return r;
64 | }
65 |
66 | function r2s(t)
67 | {
68 | var c, n;
69 | var r='', s=0, a=0;
70 | var tl=t.length;
71 |
72 | for(n=0; n= 0)
76 | {
77 | if(s) r+=String.fromCharCode(a | (c>>(6-s))&255);
78 | s=(s+2)&7;
79 | a=(c<
2 |
3 |
4 | JavaScript Public Key Encryption
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
32 |
33 |
34 |
35 |
36 | Javascript PGP/GPG packet decoder
37 | © 2011 Herbert Hanewinkel
38 |
39 | PGP packets are internally structured by tags.
40 | This decoder lists the tags and it's contents.
41 |
42 | - For private key decryption only CAST-128 with SHA-1 checksum
43 | of RSA keys is implemented.
44 | - For message decryption only RSA and AES are implemented.
45 |
46 |
47 |
48 |
49 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/lib/css/zenburn.css:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov
4 | based on dark.css by Ivan Sagalaev
5 |
6 | */
7 |
8 | pre code {
9 | display: block; padding: 0.5em;
10 | background: #3F3F3F;
11 | color: #DCDCDC;
12 | }
13 |
14 | pre .keyword,
15 | pre .tag,
16 | pre .django .tag,
17 | pre .django .keyword,
18 | pre .css .class,
19 | pre .css .id,
20 | pre .lisp .title {
21 | color: #E3CEAB;
22 | }
23 |
24 | pre .django .template_tag,
25 | pre .django .variable,
26 | pre .django .filter .argument {
27 | color: #DCDCDC;
28 | }
29 |
30 | pre .number,
31 | pre .date {
32 | color: #8CD0D3;
33 | }
34 |
35 | pre .dos .envvar,
36 | pre .dos .stream,
37 | pre .variable,
38 | pre .apache .sqbracket {
39 | color: #EFDCBC;
40 | }
41 |
42 | pre .dos .flow,
43 | pre .diff .change,
44 | pre .python .exception,
45 | pre .python .built_in,
46 | pre .literal,
47 | pre .tex .special {
48 | color: #EFEFAF;
49 | }
50 |
51 | pre .diff .chunk,
52 | pre .ruby .subst {
53 | color: #8F8F8F;
54 | }
55 |
56 | pre .dos .keyword,
57 | pre .python .decorator,
58 | pre .class .title,
59 | pre .haskell .label,
60 | pre .function .title,
61 | pre .ini .title,
62 | pre .diff .header,
63 | pre .ruby .class .parent,
64 | pre .apache .tag,
65 | pre .nginx .built_in,
66 | pre .tex .command,
67 | pre .input_number {
68 | color: #efef8f;
69 | }
70 |
71 | pre .dos .winutils,
72 | pre .ruby .symbol,
73 | pre .ruby .symbol .string,
74 | pre .ruby .symbol .keyword,
75 | pre .ruby .symbol .keymethods,
76 | pre .ruby .string,
77 | pre .ruby .instancevar {
78 | color: #DCA3A3;
79 | }
80 |
81 | pre .diff .deletion,
82 | pre .string,
83 | pre .tag .value,
84 | pre .preprocessor,
85 | pre .built_in,
86 | pre .sql .aggregate,
87 | pre .javadoc,
88 | pre .smalltalk .class,
89 | pre .smalltalk .localvars,
90 | pre .smalltalk .array,
91 | pre .css .rules .value,
92 | pre .attr_selector,
93 | pre .pseudo,
94 | pre .apache .cbracket,
95 | pre .tex .formula {
96 | color: #CC9393;
97 | }
98 |
99 | pre .shebang,
100 | pre .diff .addition,
101 | pre .comment,
102 | pre .java .annotation,
103 | pre .template_comment,
104 | pre .pi,
105 | pre .doctype {
106 | color: #7F9F7F;
107 | }
108 |
109 | pre .xml .css,
110 | pre .xml .javascript,
111 | pre .xml .vbscript,
112 | pre .tex .formula {
113 | opacity: 0.5;
114 | }
115 |
116 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/BitPadding.js:
--------------------------------------------------------------------------------
1 | /*
2 | * BitPadding.js
3 | * See BitPadding.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 | function initBitPadding( packageRoot ) {
9 | __unit( "BitPadding.js" );
10 | __uses( "packages.js" );
11 | // __uses( "trace.js" );
12 | // __uses( "elapse.js" );
13 |
14 | function BitPadding() {
15 | }
16 |
17 | function maxsize( length ){
18 | return length-1;
19 | }
20 |
21 | function encode( input, length ) {
22 | // if length is not specified, calculate the sufficient length for the length of input data.
23 | if ( length == null ) {
24 | length = input.length+1;
25 | }
26 |
27 | var maxsize = length -1;
28 |
29 | // trim input data if input data length exceeds the specified length by "length" parameter.
30 | // -1 for the terminater byte.
31 | if ( maxsize < input.length ) {
32 | throw "the size of input data (" + input.length + " bytes) must not exceed " + maxsize + "byte. \n"+maxsize+"(maxsize)="+length+"(bit-length of the RSA key )-1(size of the terminator byte)";
33 | }
34 |
35 | // Create output array.
36 | var output = new Array( length );
37 |
38 | for ( var i=0; i
3 | Copyright Tero Piirainen (tipiirai)
4 | License MIT / http://bit.ly/mit-license
5 | Version 0.96
6 |
7 | http://headjs.com
8 | */(function(a){function z(){d||(d=!0,s(e,function(a){p(a)}))}function y(c,d){var e=a.createElement("script");e.type="text/"+(c.type||"javascript"),e.src=c.src||c,e.async=!1,e.onreadystatechange=e.onload=function(){var a=e.readyState;!d.done&&(!a||/loaded|complete/.test(a))&&(d.done=!0,d())},(a.body||b).appendChild(e)}function x(a,b){if(a.state==o)return b&&b();if(a.state==n)return k.ready(a.name,b);if(a.state==m)return a.onpreload.push(function(){x(a,b)});a.state=n,y(a.url,function(){a.state=o,b&&b(),s(g[a.name],function(a){p(a)}),u()&&d&&s(g.ALL,function(a){p(a)})})}function w(a,b){a.state===undefined&&(a.state=m,a.onpreload=[],y({src:a.url,type:"cache"},function(){v(a)}))}function v(a){a.state=l,s(a.onpreload,function(a){a.call()})}function u(a){a=a||h;var b;for(var c in a){if(a.hasOwnProperty(c)&&a[c].state!=o)return!1;b=!0}return b}function t(a){return Object.prototype.toString.call(a)=="[object Function]"}function s(a,b){if(!!a){typeof a=="object"&&(a=[].slice.call(a));for(var c=0;c
2 |
3 |
4 |
5 |
6 |
7 | reveal.js - Markdown Demo
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
35 |
36 |
37 |
53 |
54 |
55 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/notes/notes.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Handles opening of and synchronization with the reveal.js
3 | * notes window.
4 | */
5 | var RevealNotes = (function() {
6 |
7 | function openNotes() {
8 | var jsFileLocation = document.querySelector('script[src$="notes.js"]').src; // this js file path
9 | jsFileLocation = jsFileLocation.replace(/notes\.js(\?.*)?$/, ''); // the js folder path
10 | var notesPopup = window.open( jsFileLocation + 'notes.html', 'reveal.js - Notes', 'width=1120,height=850' );
11 |
12 | // Fires when slide is changed
13 | Reveal.addEventListener( 'slidechanged', function( event ) {
14 | post('slidechanged');
15 | } );
16 |
17 | // Fires when a fragment is shown
18 | Reveal.addEventListener( 'fragmentshown', function( event ) {
19 | post('fragmentshown');
20 | } );
21 |
22 | // Fires when a fragment is hidden
23 | Reveal.addEventListener( 'fragmenthidden', function( event ) {
24 | post('fragmenthidden');
25 | } );
26 |
27 | /**
28 | * Posts the current slide data to the notes window
29 | *
30 | * @param {String} eventType Expecting 'slidechanged', 'fragmentshown'
31 | * or 'fragmenthidden' set in the events above to define the needed
32 | * slideDate.
33 | */
34 | function post( eventType ) {
35 | var slideElement = Reveal.getCurrentSlide(),
36 | messageData;
37 |
38 | if( eventType === 'slidechanged' ) {
39 | var notes = slideElement.querySelector( 'aside.notes' ),
40 | indexh = Reveal.getIndices().h,
41 | indexv = Reveal.getIndices().v,
42 | nextindexh,
43 | nextindexv;
44 |
45 | if( slideElement.nextElementSibling && slideElement.parentNode.nodeName == 'SECTION' ) {
46 | nextindexh = indexh;
47 | nextindexv = indexv + 1;
48 | } else {
49 | nextindexh = indexh + 1;
50 | nextindexv = 0;
51 | }
52 |
53 | messageData = {
54 | notes : notes ? notes.innerHTML : '',
55 | indexh : indexh,
56 | indexv : indexv,
57 | nextindexh : nextindexh,
58 | nextindexv : nextindexv,
59 | markdown : notes ? typeof notes.getAttribute( 'data-markdown' ) === 'string' : false
60 | };
61 | }
62 | else if( eventType === 'fragmentshown' ) {
63 | messageData = {
64 | fragment : 'next'
65 | };
66 | }
67 | else if( eventType === 'fragmenthidden' ) {
68 | messageData = {
69 | fragment : 'prev'
70 | };
71 | }
72 |
73 | notesPopup.postMessage( JSON.stringify( messageData ), '*' );
74 | }
75 |
76 | // Navigate to the current slide when the notes are loaded
77 | notesPopup.addEventListener( 'load', function( event ) {
78 | post('slidechanged');
79 | }, false );
80 | }
81 |
82 | // If the there's a 'notes' query set, open directly
83 | if( window.location.search.match( /(\?|\&)notes/gi ) !== null ) {
84 | openNotes();
85 | }
86 |
87 | // Open the notes when the 's' key is hit
88 | document.addEventListener( 'keydown', function( event ) {
89 | // Disregard the event if the target is editable or a
90 | // modifier is present
91 | if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
92 |
93 | if( event.keyCode === 83 ) {
94 | event.preventDefault();
95 | openNotes();
96 | }
97 | }, false );
98 |
99 | return { open: openNotes };
100 | })();
101 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/requestHandlers.js:
--------------------------------------------------------------------------------
1 | var fs = require("./fileSystem.js");
2 | var url = require("url");
3 | var querystring = require("querystring");
4 |
5 | var fis = require("fs");
6 | var chat = require("./chat.js");
7 | var constants = require("./constants.js");
8 |
9 | function start(request, response) {
10 | fs.getHTMLFile(url.parse(request.url).pathname,function(data){
11 | if(data!=""){
12 | response.writeHead(200, {'Content-Type':'text/html'});
13 | response.write(data);
14 | response.end();}else{
15 | fs.getHTMLFile("index.html",function(data){
16 | response.write(data);
17 | response.end();
18 | });
19 | }
20 | });
21 | }
22 |
23 | function javascriptFile(request, response){
24 | fs.getJavascriptFile(url.parse(request.url).pathname,function(data){
25 | if(data!=""){
26 | response.writeHead(200, {'Content-Type':'text/javascript'});
27 | response.write(data);
28 | response.end();}else{
29 | response.write("not found");
30 | response.end();
31 | }
32 | });
33 | }
34 |
35 | /*
36 | function registerUser(request, response){
37 | //hier den Request weiterleiten auf: chat.js registerUser(author, receiver, message); (am besten mit callback funktion!)
38 | var postData = "";
39 |
40 | request.setEncoding("utf8");
41 |
42 | request.addListener("data", function(postDataChunk) {
43 | postData += postDataChunk;
44 | });
45 |
46 | request.addListener("end", function() {
47 | var postString = querystring.parse(postData);
48 | var username = postString[constants.REGISTER_USER_FIELDNAME_USERNAME];
49 | var privKey = postString[constants.REGISTER_USER_FIELDNAME_PRIVATE_KEY];
50 | var pubKey = postString[constants.REGISTER_USER_FIELDNAME_PUBLIC_KEY];
51 | var password = postString[constants.REGISTER_USER_FIELDNAME_PASSWORD];
52 | chat.registerUser(username, pubKey, privKey, password, function(res){
53 | if(res){
54 | response.writeHead(200, {'Content-Type':'text/html'});
55 | response.write("Erfolg! -> hier gehts weiter!");
56 | response.end();
57 | }else{
58 | response.writeHead(200, {'Content-Type':'text/html'});
59 | response.write("Fehler");
60 | response.end();
61 | }
62 | });
63 | });
64 |
65 | }
66 | */
67 |
68 | function registerUser(request, response){
69 |
70 | var username = request.body[constants.REGISTER_USER_FIELDNAME_USERNAME];
71 | var privKey = request.body[constants.REGISTER_USER_FIELDNAME_PRIVATE_KEY];
72 | var pubKey = request.body[constants.REGISTER_USER_FIELDNAME_PUBLIC_KEY];
73 | var password = request.body[constants.REGISTER_USER_FIELDNAME_PASSWORD];
74 | chat.registerUser(username, pubKey, privKey, password, function(res){
75 | if(res){
76 | response.writeHead(200, {'Content-Type':'text/html'});
77 | response.write("Erfolg! -> hier gehts weiter!");
78 | response.end();
79 | }else{
80 | response.writeHead(200, {'Content-Type':'text/html'});
81 | response.write("Fehler");
82 | response.end();
83 | }
84 | });
85 |
86 | }
87 |
88 | exports.start = start;
89 | exports.javascriptFile=javascriptFile;
90 | exports.registerUser = registerUser;
91 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/nowchat.js:
--------------------------------------------------------------------------------
1 | var nowjs = require("now");
2 | var chat = require("./chat.js");
3 |
4 | var everyone;
5 | var usergroups = new Object(); // In dieser Variablen werden alle Clients gespeichert, welche sich mit dem selben Usernam angemeldet haben.
6 |
7 | function start(server){
8 |
9 | everyone = nowjs.initialize(server);
10 |
11 |
12 | everyone.connected(function(){
13 | console.log("Joined: " + this.now.name + " Client-ID: "+this.user.clientId);
14 | });
15 |
16 |
17 | everyone.disconnected(function(){
18 | if(this.now.name != null || this.now.name != undefined){
19 | //chat.setUserOnlineStatus(this.now.name, false);
20 |
21 | }
22 | console.log("Left: " + this.now.name);
23 | });
24 |
25 | //everyone.now.distributeMessage = function(message){
26 | // everyone.now.receiveMessage(this.now.name, message);
27 | //};
28 |
29 | everyone.now.sendMessage = function(receiver, message){
30 | var clientID = this.user.clientId;
31 | var timestamp = new Date();
32 | chat.getUserName(this.user.clientId, function(username){
33 | chat.sendMessage(username, clientID, receiver, message,function(ret){
34 | if(ret == 1){
35 | console.log("User "+username+" sendet Nachricht an "+receiver);
36 | //sendMessageToUser(receiver, username, message);
37 | nowjs.getGroup(receiver).now.updateMessages();
38 | }else{
39 | console.log("User "+username+" konnte Nachricht nicht an "+receiver+" senden");
40 | }
41 | });
42 | });
43 | };
44 |
45 | everyone.now.getUsers = function(){
46 | chat.getUsers( this.now.receiveUsers);
47 | }
48 |
49 | function sendMessageToUser(username, message){
50 | try{
51 | nowjs.getGroup(username).now.receiveMessage(JSON.stringify(message));
52 | }catch(e){
53 | console.log("Fehler beim Senden von Nachricht an Benutzer "+username+": "+e);
54 | }
55 | }
56 |
57 | everyone.now.getMessages = function(){
58 | var clientID = this.user.clientId;
59 | chat.getUserName(clientID, function(username){
60 | if(username != null && username != undefined){
61 | chat.checkUserLogin(username, clientID, function(ret){
62 | if(ret == 1){
63 | //chat.getMessages(username, function(names, messages){
64 | // for(i=0; i
2 |
3 |
4 |
5 |
6 | reveal.js - Slide Notes
7 |
8 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 | UPCOMING:
98 |
99 |
100 |
101 |
102 |
103 |
104 |
137 |
138 |
139 |
140 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/source/uulm-base.scss:
--------------------------------------------------------------------------------
1 | // Background generator
2 | @mixin bodyBackground() {
3 | @include radial-gradient( #bebebe, #f0f0f0 );
4 | }
5 |
6 |
7 | // Theme template ------------------------------
8 | @import "../template/theme";
9 | // ---------------------------------------------
10 |
11 |
12 |
13 | // Rounded corners for slide
14 | @mixin rounded-corners {
15 | border-radius: 10px;
16 | -moz-border-radius: 10px;
17 | }
18 |
19 |
20 | .reveal {
21 | // Generic styling
22 |
23 | letter-spacing: -1px;
24 | line-height: 36px;
25 | text-shadow: 0 1px 1px rgba(0,0,0,0.1);
26 |
27 | .slides section {
28 | height: 675px;
29 | width: 900px;
30 | }
31 |
32 | section img {
33 | border: 0;
34 | box-shadow: none;
35 | }
36 |
37 | .frame {
38 | border: 2px solid #666666;
39 | box-shadow: 0 0 10px rgba(0,0,0, 0.2);
40 | }
41 |
42 | .float-right {
43 | float: right;
44 | }
45 |
46 | .float-left {
47 | float: left;
48 | }
49 |
50 | h1 {
51 | font-size: 60px;
52 | line-height: 60px;
53 | padding: 0;
54 | margin: 0;
55 | margin-top: 200px;
56 | padding-right: 40px;
57 | font-weight: 600;
58 | letter-spacing: -3px;
59 | }
60 |
61 | h2 {
62 | font-size: 45px;
63 | line-height: 45px;
64 | padding: 0;
65 | margin: 0;
66 | padding-right: 40px;
67 | padding-bottom: 30px;
68 | font-weight: 600;
69 | letter-spacing: -2px;
70 | }
71 |
72 | h3 {
73 | font-size: 30px;
74 | line-height: 36px;
75 | padding: 0;
76 | margin: 0;
77 | padding-right: 40px;
78 | padding-bottom: 15px;
79 | font-weight: 600;
80 | letter-spacing: -1px;
81 | }
82 |
83 | p {
84 | margin: 0 0 20px 0;
85 | }
86 |
87 | li {
88 | padding: 0;
89 | margin: 0 0 0.4em;
90 | }
91 |
92 | ul li {
93 | list-style: none outside none;
94 |
95 | &:before {
96 | color: $highlightColor;
97 | content: "·";
98 | margin-left: -0.75em;
99 | width: 0.75em;
100 | margin-right: 0.5em;
101 | }
102 | }
103 |
104 |
105 | .slides {
106 | text-align: left;
107 |
108 | // White page background for current slide
109 | section:not(.stack).present {
110 | @include rounded-corners;
111 | border: 1px solid rgba(0,0,0,0.3);
112 | box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
113 | background-color: white;
114 | }
115 |
116 |
117 | // Page style: normal
118 | div.normal {
119 | padding: 20px 60px 32px;
120 | }
121 |
122 |
123 | // Page style: title
124 | div.title {
125 | padding: 20px 60px;
126 |
127 | > img.header {
128 | position: absolute;
129 | left: 0;
130 | top: 20%;
131 | height: 50%;
132 | width: 100%;
133 | min-height: 50%;
134 | min-width: 100%;
135 | margin: 0;
136 | z-index: -1;
137 | }
138 |
139 | .belowheader {
140 | position: absolute;
141 | top: 70%;
142 | padding-top: 1ex;
143 | }
144 |
145 | .belowheader h1 {
146 | margin: 0;
147 | }
148 | }
149 |
150 |
151 | // Page style: fill
152 | div.fill {
153 | padding: 20px 60px 32px;
154 |
155 | h2 {
156 | background: rgba(255, 255, 255, .75);
157 | padding-top: .2em;
158 | padding-bottom: .3em;
159 | margin-top: .3em;
160 | margin-bottom: .3em;
161 | margin-left: -60px;
162 | padding-left: 60px;
163 | margin-right: -60px;
164 | padding-right: 60px;
165 | }
166 |
167 | > img {
168 | margin: 0;
169 | border: 0;
170 | @include rounded-corners;
171 | position: absolute;
172 | left: 0;
173 | top: 0;
174 | min-height: 100%;
175 | min-width: 100%;
176 | z-index: -1;
177 | }
178 | }
179 | }
180 | }
181 |
182 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat.js:
--------------------------------------------------------------------------------
1 | var database = require('./database.js');
2 | var passwordHash = require('password-hash');
3 |
4 | function sendMessage(author, authorSessionId, receiver, message, callback){
5 | if(callback == undefined) callback = function(ret){console.log("Return from sendMessage: "+ret)};
6 | database.getUsernameFromEnabledSession(authorSessionId, function(ret){
7 | if(ret != false){
8 | database.addMessage(author, receiver, message, callback);
9 | }else{
10 | callback(false);
11 | }
12 | });
13 | }
14 |
15 | function getMessages(forUser, callback){
16 | //hier gibt es noch viel zu tun... Auf der Clientseite sollten die Nachrichten nach dem Erfassungsdatum sotiert werden (Messages.Zeitpunkt in der Datenbank)
17 | database.getMessages(forUser, callback);
18 | }
19 |
20 | function registerUser(username, pubKey, privKey, password, callback){
21 | //hier muss mithile von database.js der User registriert werden. Davor eingegebene Werte prüfen!
22 | password = passwordHash.generate(password); // Passwort wird als Hash abgespeichert
23 | database.addUser(username, pubKey, privKey, password, callback);
24 | }
25 |
26 | /*
27 | function getUserQuestion(username, callback){
28 | database.getUserQuestion(username,callback);
29 | }
30 | */
31 |
32 | function getUserPrivateKey(name, password, callback){
33 | verifyUserPW(name, password, function(ret){
34 | if(ret == true){
35 | database.getUserPrivateKey(name, callback);
36 | }else{
37 | return null;
38 | }
39 | });
40 | }
41 |
42 | /**
43 | Interne/privat Funktion
44 | Wird ein gültiger username und passwort übergeben wird callback mit true,
45 | ansonsten mit false aufgerufen.
46 | */
47 | function verifyUserPW(username, userpw, callback){
48 | database.getUserPW(username, function(ret){
49 | if(ret != null){
50 | callback(passwordHash.verify(userpw, ret));
51 | }else{
52 | callback(false);
53 | }
54 | });
55 | }
56 |
57 | function createUserSession(username, password, session){
58 |
59 | }
60 |
61 | /*
62 | callback wird mit zwei String-Arrays aufgerufen, welche name und pubkey enthalten:
63 | callback(names, pubkeys)
64 | */
65 | function getUsers(callback){
66 | database.getAllUsers(callback);
67 | }
68 |
69 | //function getUserPublicKey(name, callback){
70 | // database.getUserPublicKey
71 | //}
72 |
73 | /*
74 | Registriert eine sessionID auf einen Usernamen. Dadurch gilt ein Benutzer als eingelogt.
75 | 1, falls erfolg!
76 | 0, falls Fehler!
77 | */
78 | function userLogin(username, sessionID, callback){
79 | database.createSession(username, sessionID, callback);
80 | }
81 |
82 | function userLogout(username, sessionID){
83 | return false;
84 | }
85 |
86 | /*
87 | checkUserLogin:
88 | returns true, falls user momentan mit diese session eingelogt ist.
89 | */
90 | function checkUserLogin(username, session, callback){
91 | getUserName(session, function(ret){
92 | if(ret = username){
93 | callback(true);
94 | }else{
95 | callback(false);
96 | }
97 | });
98 | }
99 |
100 | /*
101 | Liefert den Usernamen, welcher der übergebenen Session/ClientId zugeordnet ist.
102 | */
103 | function getUserName(session, callback){
104 | database.getUsernameFromEnabledSession(session, callback);
105 | }
106 |
107 | var onlineUser = new Object();
108 |
109 | function setUserOnlineStatus(username, online){
110 | //Diese Funktion könnte auch mittels Datenbank umgesetzt werden.
111 | onlineUser[username]=online;
112 | }
113 |
114 | function getUserOnlineStatus(username){
115 | return onlineUser[username];
116 | }
117 |
118 | exports.getUsers = getUsers;
119 | exports.registerUser = registerUser;
120 | exports.getUserPrivateKey = getUserPrivateKey;
121 | //exports.getUserPublicKey = getUserPublicKey;
122 | exports.setUserOnlineStatus = setUserOnlineStatus;
123 | exports.getUserOnlineStatus = getUserOnlineStatus;
124 | exports.getMessages = getMessages;
125 | exports.sendMessage = sendMessage;
126 | exports.userLogin = userLogin;
127 | exports.userLogout = userLogout;
128 | exports.checkUserLogin = checkUserLogin;
129 | exports.getUserName = getUserName;
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/RSAKeyFormat.js:
--------------------------------------------------------------------------------
1 | /*
2 | * RSAKeyFormat.js
3 | * See RSAKeyFormat.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 | function initRSAKeyFormat( packageRoot ) {
9 | __unit( "RSAKeyFormat.js" );
10 | __uses( "packages.js" );
11 | __uses( "BigInteger.init1.js" );
12 | __uses( "binary.js" );
13 | __uses( "SOAEP.js" );
14 |
15 | var BigInteger = __import( packageRoot, "titaniumcore.crypto.BigInteger" );
16 | var SOAEP = __import( packageRoot, "titaniumcore.crypto.SOAEP" );
17 |
18 | var createReader = function(value) {
19 | var idx=0;
20 | return {
21 | read_block : function() {
22 | var size = ba2i( value.slice(idx,idx+4) );
23 | idx+=4;
24 | if ( value.lengthsection,
127 | .reveal .slides>section>section {
128 |
129 | visibility: visible !important;
130 | position: static !important;
131 | width: 90% !important;
132 | height: auto !important;
133 | display: block !important;
134 | overflow: visible !important;
135 |
136 | left: 0% !important;
137 | top: 0% !important;
138 | margin-left: 0px !important;
139 | margin-top: 0px !important;
140 | padding: 20px 0px !important;
141 |
142 | opacity: 1 !important;
143 |
144 | -webkit-transform-style: flat !important;
145 | -moz-transform-style: flat !important;
146 | -ms-transform-style: flat !important;
147 | transform-style: flat !important;
148 |
149 | -webkit-transform: none !important;
150 | -moz-transform: none !important;
151 | -ms-transform: none !important;
152 | transform: none !important;
153 | }
154 | .reveal section {
155 | page-break-after: always !important;
156 | display: block !important;
157 | }
158 | .reveal section .fragment {
159 | opacity: 1 !important;
160 | visibility: visible !important;
161 |
162 | -webkit-transform: none !important;
163 | -moz-transform: none !important;
164 | -ms-transform: none !important;
165 | transform: none !important;
166 | }
167 | .reveal section:last-of-type {
168 | page-break-after: avoid !important;
169 | }
170 | .reveal section img {
171 | display: block;
172 | margin: 15px 0px;
173 | background: rgba(255,255,255,1);
174 | border: 1px solid #666;
175 | box-shadow: none;
176 | }
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/markdown/markdown.js:
--------------------------------------------------------------------------------
1 | // From https://gist.github.com/1343518
2 | // Modified by Hakim to handle Markdown indented with tabs
3 | (function(){
4 |
5 | if( typeof Showdown === 'undefined' ) {
6 | throw 'The reveal.js Markdown plugin requires Showdown to be loaded';
7 | }
8 |
9 | var stripLeadingWhitespace = function(section) {
10 |
11 | var template = section.querySelector( 'script' );
12 |
13 | // strip leading whitespace so it isn't evaluated as code
14 | var text = ( template || section ).textContent;
15 |
16 | var leadingWs = text.match(/^\n?(\s*)/)[1].length,
17 | leadingTabs = text.match(/^\n?(\t*)/)[1].length;
18 |
19 | if( leadingTabs > 0 ) {
20 | text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' );
21 | }
22 | else if( leadingWs > 1 ) {
23 | text = text.replace( new RegExp('\\n? {' + leadingWs + '}','g'), '\n' );
24 | }
25 |
26 | return text;
27 |
28 | };
29 |
30 | var slidifyMarkdown = function(markdown, separator, vertical) {
31 |
32 | separator = separator || '^\n---\n$';
33 |
34 | var reSeparator = new RegExp(separator + (vertical ? '|' + vertical : ''), 'mg'),
35 | reHorSeparator = new RegExp(separator),
36 | matches,
37 | lastIndex = 0,
38 | isHorizontal,
39 | wasHorizontal = true,
40 | content,
41 | sectionStack = [],
42 | markdownSections = '';
43 |
44 | // iterate until all blocks between separators are stacked up
45 | while( matches = reSeparator.exec(markdown) ) {
46 |
47 | // determine direction (horizontal by default)
48 | isHorizontal = reHorSeparator.test(matches[0]);
49 |
50 | if( !isHorizontal && wasHorizontal ) {
51 | // create vertical stack
52 | sectionStack.push([]);
53 | }
54 |
55 | // pluck slide content from markdown input
56 | content = markdown.substring(lastIndex, matches.index);
57 |
58 | if( isHorizontal && wasHorizontal ) {
59 | // add to horizontal stack
60 | sectionStack.push(content);
61 | } else {
62 | // add to vertical stack
63 | sectionStack[sectionStack.length-1].push(content);
64 | }
65 |
66 | lastIndex = reSeparator.lastIndex;
67 | wasHorizontal = isHorizontal;
68 |
69 | }
70 |
71 | // add the remaining slide
72 | (wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1]).push(markdown.substring(lastIndex));
73 |
74 | // flatten the hierarchical stack, and insert tags
75 | for( var k = 0, klen = sectionStack.length; k < klen; k++ ) {
76 | markdownSections += typeof sectionStack[k] === 'string'
77 | ? ''
78 | : '' + sectionStack[k].join('';
79 | }
80 |
81 | return markdownSections;
82 | };
83 |
84 | var querySlidingMarkdown = function() {
85 |
86 | var sections = document.querySelectorAll( '[data-markdown]'),
87 | section;
88 |
89 | for( var j = 0, jlen = sections.length; j < jlen; j++ ) {
90 |
91 | section = sections[j];
92 |
93 | if( section.getAttribute('data-markdown').length ) {
94 |
95 | var xhr = new XMLHttpRequest(),
96 | url = section.getAttribute('data-markdown');
97 |
98 | xhr.onreadystatechange = function () {
99 | if( xhr.readyState === 4 ) {
100 | section.outerHTML = slidifyMarkdown( xhr.responseText, section.getAttribute('data-separator'), section.getAttribute('data-vertical') );
101 | }
102 | };
103 |
104 | xhr.open('GET', url, false);
105 | xhr.send();
106 |
107 | } else if( section.getAttribute('data-separator') ) {
108 |
109 | var markdown = stripLeadingWhitespace(section);
110 | section.outerHTML = slidifyMarkdown( markdown, section.getAttribute('data-separator'), section.getAttribute('data-vertical') );
111 |
112 | }
113 | }
114 |
115 | };
116 |
117 | var queryMarkdownSlides = function() {
118 |
119 | var sections = document.querySelectorAll( '[data-markdown]');
120 |
121 | for( var j = 0, jlen = sections.length; j < jlen; j++ ) {
122 |
123 | makeHtml(sections[j]);
124 |
125 | }
126 |
127 | };
128 |
129 | var makeHtml = function(section) {
130 |
131 | var notes = section.querySelector( 'aside.notes' );
132 |
133 | var markdown = stripLeadingWhitespace(section);
134 |
135 | section.innerHTML = (new Showdown.converter()).makeHtml(markdown);
136 |
137 | if( notes ) {
138 | section.appendChild( notes );
139 | }
140 |
141 | };
142 |
143 | querySlidingMarkdown();
144 |
145 | queryMarkdownSlides();
146 |
147 | })();
148 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/SecureRandom.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SecureRandom.js
3 | * A Secure Random Number Generator
4 | * See SecureRandom.readme.txt for further information.
5 | *
6 | * ACKNOWLEDGMENT
7 | *
8 | * This library is originally written by Tom Wu
9 | *
10 | * Copyright (c) 2005 Tom Wu
11 | * All Rights Reserved.
12 | * http://www-cs-students.stanford.edu/~tjw/jsbn/
13 | *
14 | * MODIFICATION
15 | *
16 | * Some modifications are applied by Atsushi Oka
17 | *
18 | * Atushi Oka
19 | * http://oka.nu/
20 | *
21 | * - Packaged
22 | * - Added Object-Oriented Interface.
23 | */
24 |
25 | function initRNG( packages ) {
26 | __unit( "SecureRandom.js" );
27 | __uses( "packages.js" );
28 |
29 | /////////////////////////////////////////////
30 | // import
31 | /////////////////////////////////////////////
32 | // var Arcfour = __package( packages ).Arcfour;
33 |
34 | /////////////////////////////////////
35 | // implementation
36 | /////////////////////////////////////
37 |
38 | //
39 | // Arcfour
40 | //
41 | var Arcfour = function () {
42 | this.i = 0;
43 | this.j = 0;
44 | this.S = new Array();
45 | };
46 |
47 | // Initialize arcfour context from key, an array of ints, each from [0..255]
48 | Arcfour.prototype.init = function (key) {
49 | var i, j, t;
50 | for(i = 0; i < 256; ++i)
51 | this.S[i] = i;
52 | j = 0;
53 | for(i = 0; i < 256; ++i) {
54 | j = (j + this.S[i] + key[i % key.length]) & 255;
55 | t = this.S[i];
56 | this.S[i] = this.S[j];
57 | this.S[j] = t;
58 | }
59 | this.i = 0;
60 | this.j = 0;
61 | };
62 |
63 | Arcfour.prototype.next = function () {
64 | var t;
65 | this.i = (this.i + 1) & 255;
66 | this.j = (this.j + this.S[this.i]) & 255;
67 | t = this.S[this.i];
68 | this.S[this.i] = this.S[this.j];
69 | this.S[this.j] = t;
70 | return this.S[ ( t + this.S[this.i] ) & 255 ];
71 | };
72 |
73 |
74 | // Plug in your RNG constructor here
75 | Arcfour.create = function () {
76 | return new Arcfour();
77 | };
78 |
79 | // Pool size must be a multiple of 4 and greater than 32.
80 | // An array of bytes the size of the pool will be passed to init()
81 | Arcfour.rng_psize= 256;
82 |
83 | //
84 | // SecureRandom
85 | //
86 |
87 | var rng_state = null;
88 | var rng_pool = [];
89 | var rng_pptr = 0;
90 |
91 | // Mix in a 32-bit integer into the pool
92 | rng_seed_int= function (x) {
93 | // FIXED 7 DEC,2008 http://oka.nu/
94 | // >>
95 | // rng_pool[rng_pptr++] ^= x & 255;
96 | // rng_pool[rng_pptr++] ^= (x >> 8) & 255;
97 | // rng_pool[rng_pptr++] ^= (x >> 16) & 255;
98 | // rng_pool[rng_pptr++] ^= (x >> 24) & 255;
99 | rng_pool[rng_pptr] ^= x & 255;
100 | rng_pptr++;
101 | rng_pool[rng_pptr] ^= (x >> 8) & 255;
102 | rng_pptr++;
103 | rng_pool[rng_pptr] ^= (x >> 16) & 255;
104 | rng_pptr++;
105 | rng_pool[rng_pptr] ^= (x >> 24) & 255;
106 | rng_pptr++;
107 | // <<
108 | if(rng_pptr >= Arcfour.rng_psize) rng_pptr -= Arcfour.rng_psize;
109 | };
110 |
111 | // Mix in the current time (w/milliseconds) into the pool
112 | rng_seed_time= function () {
113 | rng_seed_int( new Date().getTime() );
114 | };
115 |
116 | // Initialize the pool with junk if needed.
117 | pool_init= function () {
118 | var t;
119 | if ( navigator.appName == "Netscape" && navigator.appVersion < "5" && window.crypto ) {
120 | // Extract entropy (256 bits) from NS4 RNG if available
121 | var z = window.crypto.random(32);
122 | for(t = 0; t < z.length; ++t)
123 | rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
124 | }
125 | while(rng_pptr < Arcfour.rng_psize) { // extract some randomness from Math.random()
126 | t = Math.floor(65536 * Math.random());
127 | rng_pool[rng_pptr++] = t >>> 8;
128 | rng_pool[rng_pptr++] = t & 255;
129 | }
130 | rng_pptr = 0;
131 | rng_seed_time();
132 | //rng_seed_int(window.screenX);
133 | //rng_seed_int(window.screenY);
134 | };
135 |
136 | var rng_get_byte= function () {
137 | if ( rng_state == null ) {
138 | rng_seed_time();
139 | // rng_state = Arcfour.prng_newstate();
140 | rng_state = Arcfour.create();
141 | rng_state.init( rng_pool );
142 | for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
143 | rng_pool[rng_pptr] = 0;
144 | rng_pptr = 0;
145 | //rng_pool = null;
146 | }
147 | // TODO: allow reseeding after first request
148 | return rng_state.next();
149 | };
150 |
151 | var SecureRandom = function () {
152 | };
153 | SecureRandom.prototype.nextBytes = function (ba) {
154 | for ( var i = 0; i < ba.length; ++i )
155 | ba[i] = rng_get_byte();
156 | };
157 |
158 | // initialize
159 | pool_init();
160 |
161 | ///////////////////////////////////////////
162 | // export
163 | ///////////////////////////////////////////
164 | // __package( packages, path ).RNG = RNG;
165 | // __package( packages, path ).SecureRandom = SecureRandom;
166 | __export( packages, "titaniumcore.crypto.SecureRandom", SecureRandom );
167 | };
168 | initRNG( this );
169 |
170 |
171 | // vim:ts=8 sw=4:noexpandtab:
172 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/beige.css:
--------------------------------------------------------------------------------
1 | @import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
2 | /**
3 | * Beige theme for reveal.js.
4 | *
5 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
6 | */
7 | @font-face {
8 | font-family: 'League Gothic';
9 | src: url("../../lib/font/league_gothic-webfont.eot");
10 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg");
11 | font-weight: normal;
12 | font-style: normal;
13 | }
14 |
15 | /*********************************************
16 | * GLOBAL STYLES
17 | *********************************************/
18 | body {
19 | background: #f7f2d3;
20 | background: -moz-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
21 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, white), color-stop(100%, #f7f2d3));
22 | background: -webkit-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
23 | background: -o-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
24 | background: -ms-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
25 | background: radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
26 | background-color: #f7f3de;
27 | }
28 |
29 | .reveal {
30 | font-family: "Lato", Times, "Times New Roman", serif;
31 | font-size: 36px;
32 | font-weight: 200;
33 | letter-spacing: -0.02em;
34 | color: #333333;
35 | }
36 |
37 | ::selection {
38 | color: white;
39 | background: rgba(79, 64, 28, 0.99);
40 | text-shadow: none;
41 | }
42 |
43 | /*********************************************
44 | * HEADERS
45 | *********************************************/
46 | .reveal h1,
47 | .reveal h2,
48 | .reveal h3,
49 | .reveal h4,
50 | .reveal h5,
51 | .reveal h6 {
52 | margin: 0 0 20px 0;
53 | color: #333333;
54 | font-family: "League Gothic", Impact, sans-serif;
55 | line-height: 0.9em;
56 | letter-spacing: 0.02em;
57 | text-transform: uppercase;
58 | text-shadow: none;
59 | }
60 |
61 | .reveal h1 {
62 | text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15);
63 | }
64 |
65 | /*********************************************
66 | * LINKS
67 | *********************************************/
68 | .reveal a:not(.image) {
69 | color: #8b743d;
70 | text-decoration: none;
71 | -webkit-transition: color .15s ease;
72 | -moz-transition: color .15s ease;
73 | -ms-transition: color .15s ease;
74 | -o-transition: color .15s ease;
75 | transition: color .15s ease;
76 | }
77 |
78 | .reveal a:not(.image):hover {
79 | color: #c0a86e;
80 | text-shadow: none;
81 | border: none;
82 | }
83 |
84 | .reveal .roll span:after {
85 | color: #fff;
86 | background: #564826;
87 | }
88 |
89 | /*********************************************
90 | * IMAGES
91 | *********************************************/
92 | .reveal section img {
93 | margin: 15px 0px;
94 | background: rgba(255, 255, 255, 0.12);
95 | border: 4px solid #333333;
96 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
97 | -webkit-transition: all .2s linear;
98 | -moz-transition: all .2s linear;
99 | -ms-transition: all .2s linear;
100 | -o-transition: all .2s linear;
101 | transition: all .2s linear;
102 | }
103 |
104 | .reveal a:hover img {
105 | background: rgba(255, 255, 255, 0.2);
106 | border-color: #8b743d;
107 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
108 | }
109 |
110 | /*********************************************
111 | * NAVIGATION CONTROLS
112 | *********************************************/
113 | .reveal .controls div.navigate-left,
114 | .reveal .controls div.navigate-left.enabled {
115 | border-right-color: #8b743d;
116 | }
117 |
118 | .reveal .controls div.navigate-right,
119 | .reveal .controls div.navigate-right.enabled {
120 | border-left-color: #8b743d;
121 | }
122 |
123 | .reveal .controls div.navigate-up,
124 | .reveal .controls div.navigate-up.enabled {
125 | border-bottom-color: #8b743d;
126 | }
127 |
128 | .reveal .controls div.navigate-down,
129 | .reveal .controls div.navigate-down.enabled {
130 | border-top-color: #8b743d;
131 | }
132 |
133 | .reveal .controls div.navigate-left.enabled:hover {
134 | border-right-color: #c0a86e;
135 | }
136 |
137 | .reveal .controls div.navigate-right.enabled:hover {
138 | border-left-color: #c0a86e;
139 | }
140 |
141 | .reveal .controls div.navigate-up.enabled:hover {
142 | border-bottom-color: #c0a86e;
143 | }
144 |
145 | .reveal .controls div.navigate-down.enabled:hover {
146 | border-top-color: #c0a86e;
147 | }
148 |
149 | /*********************************************
150 | * PROGRESS BAR
151 | *********************************************/
152 | .reveal .progress {
153 | background: rgba(0, 0, 0, 0.2);
154 | }
155 |
156 | .reveal .progress span {
157 | background: #8b743d;
158 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
159 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
160 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
161 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
162 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
163 | }
164 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/default.css:
--------------------------------------------------------------------------------
1 | @import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
2 | /**
3 | * Default theme for reveal.js.
4 | *
5 | * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
6 | */
7 | @font-face {
8 | font-family: 'League Gothic';
9 | src: url("../../lib/font/league_gothic-webfont.eot");
10 | src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg");
11 | font-weight: normal;
12 | font-style: normal;
13 | }
14 |
15 | /*********************************************
16 | * GLOBAL STYLES
17 | *********************************************/
18 | body {
19 | background: #1c1e20;
20 | background: -moz-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%);
21 | background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, #555a5f), color-stop(100%, #1c1e20));
22 | background: -webkit-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%);
23 | background: -o-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%);
24 | background: -ms-radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%);
25 | background: radial-gradient(center, circle cover, #555a5f 0%, #1c1e20 100%);
26 | background-color: #2b2b2b;
27 | }
28 |
29 | .reveal {
30 | font-family: "Lato", Times, "Times New Roman", serif;
31 | font-size: 36px;
32 | font-weight: 200;
33 | letter-spacing: -0.02em;
34 | color: #eeeeee;
35 | }
36 |
37 | ::selection {
38 | color: white;
39 | background: #ff5e99;
40 | text-shadow: none;
41 | }
42 |
43 | /*********************************************
44 | * HEADERS
45 | *********************************************/
46 | .reveal h1,
47 | .reveal h2,
48 | .reveal h3,
49 | .reveal h4,
50 | .reveal h5,
51 | .reveal h6 {
52 | margin: 0 0 20px 0;
53 | color: #eeeeee;
54 | font-family: "League Gothic", Impact, sans-serif;
55 | line-height: 0.9em;
56 | letter-spacing: 0.02em;
57 | text-transform: uppercase;
58 | text-shadow: 0px 0px 6px rgba(0, 0, 0, 0.2);
59 | }
60 |
61 | .reveal h1 {
62 | text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px rgba(0, 0, 0, 0.2), 0 5px 10px rgba(0, 0, 0, 0.25), 0 20px 20px rgba(0, 0, 0, 0.15);
63 | }
64 |
65 | /*********************************************
66 | * LINKS
67 | *********************************************/
68 | .reveal a:not(.image) {
69 | color: #13daec;
70 | text-decoration: none;
71 | -webkit-transition: color .15s ease;
72 | -moz-transition: color .15s ease;
73 | -ms-transition: color .15s ease;
74 | -o-transition: color .15s ease;
75 | transition: color .15s ease;
76 | }
77 |
78 | .reveal a:not(.image):hover {
79 | color: #71e9f4;
80 | text-shadow: none;
81 | border: none;
82 | }
83 |
84 | .reveal .roll span:after {
85 | color: #fff;
86 | background: #0d99a5;
87 | }
88 |
89 | /*********************************************
90 | * IMAGES
91 | *********************************************/
92 | .reveal section img {
93 | margin: 15px 0px;
94 | background: rgba(255, 255, 255, 0.12);
95 | border: 4px solid #eeeeee;
96 | box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
97 | -webkit-transition: all .2s linear;
98 | -moz-transition: all .2s linear;
99 | -ms-transition: all .2s linear;
100 | -o-transition: all .2s linear;
101 | transition: all .2s linear;
102 | }
103 |
104 | .reveal a:hover img {
105 | background: rgba(255, 255, 255, 0.2);
106 | border-color: #13daec;
107 | box-shadow: 0 0 20px rgba(0, 0, 0, 0.55);
108 | }
109 |
110 | /*********************************************
111 | * NAVIGATION CONTROLS
112 | *********************************************/
113 | .reveal .controls div.navigate-left,
114 | .reveal .controls div.navigate-left.enabled {
115 | border-right-color: #13daec;
116 | }
117 |
118 | .reveal .controls div.navigate-right,
119 | .reveal .controls div.navigate-right.enabled {
120 | border-left-color: #13daec;
121 | }
122 |
123 | .reveal .controls div.navigate-up,
124 | .reveal .controls div.navigate-up.enabled {
125 | border-bottom-color: #13daec;
126 | }
127 |
128 | .reveal .controls div.navigate-down,
129 | .reveal .controls div.navigate-down.enabled {
130 | border-top-color: #13daec;
131 | }
132 |
133 | .reveal .controls div.navigate-left.enabled:hover {
134 | border-right-color: #71e9f4;
135 | }
136 |
137 | .reveal .controls div.navigate-right.enabled:hover {
138 | border-left-color: #71e9f4;
139 | }
140 |
141 | .reveal .controls div.navigate-up.enabled:hover {
142 | border-bottom-color: #71e9f4;
143 | }
144 |
145 | .reveal .controls div.navigate-down.enabled:hover {
146 | border-top-color: #71e9f4;
147 | }
148 |
149 | /*********************************************
150 | * PROGRESS BAR
151 | *********************************************/
152 | .reveal .progress {
153 | background: rgba(0, 0, 0, 0.2);
154 | }
155 |
156 | .reveal .progress span {
157 | background: #13daec;
158 | -webkit-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
159 | -moz-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
160 | -ms-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
161 | -o-transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
162 | transition: width 800ms cubic-bezier(0.26, 0.86, 0.44, 0.985);
163 | }
164 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/PGpubkey.js:
--------------------------------------------------------------------------------
1 |
2 | /* OpenPGP public key extraction
3 | * Copyright 2005 Herbert Hanewinkel, www.haneWIN.de
4 | * version 1.1, check www.haneWIN.de for the latest version
5 |
6 | * This software is provided as-is, without express or implied warranty.
7 | * Permission to use, copy, modify, distribute or sell this software, with or
8 | * without fee, for any purpose and by any individual or organization, is hereby
9 | * granted, provided that the above copyright notice and this paragraph appear
10 | * in all copies. Distribution as a part of an application or binary must
11 | * include the above copyright notice in the documentation and/or other materials
12 | * provided with the application or distribution.
13 | */
14 |
15 | function s2hex(s)
16 | {
17 | var result = '';
18 | for(var i=0; i0) a += 2;
44 | else
45 | {
46 | a = text.indexOf('\n\r\n', i);
47 | if(a>0) a += 3;
48 | }
49 |
50 | var e=text.indexOf('\n=',i);
51 | if(a>0 && e>0) text = text.slice(a,e);
52 | else
53 | {
54 | alert('Invalid PGP Public Key Block');
55 | this.vers = '';
56 | this.fp = '';
57 | this.keyid = '';
58 | this.user = '';
59 | this.pkey = '';
60 | return;
61 | }
62 |
63 | var s=r2s(text);
64 |
65 | for(var i=0; i < s.length;)
66 | {
67 | var tag = s.charCodeAt(i++);
68 |
69 | if((tag&128) == 0) break;
70 |
71 | if(tag&64)
72 | {
73 | tag&=63;
74 | len=s.charCodeAt(i++);
75 | if(len >191 && len <224) len=((len-192)<<8) + s.charCodeAt(i++);
76 | else if(len==255) len = (s.charCodeAt(i++)<<24) + (s.charCodeAt(i++)<<16) + (s.charCodeAt(i++)<<8) + s.charCodeAt(i++);
77 | else if(len>223 &&len<255) len = (1<<(len&0x1f));
78 | }
79 | else
80 | {
81 | len = tag&3;
82 | tag = (tag>>2)&15;
83 | if(len==0) len = s.charCodeAt(i++);
84 | else if(len==1) len = (s.charCodeAt(i++)<<8) + s.charCodeAt(i++);
85 | else if(len==2) len = (s.charCodeAt(i++)<<24) + (s.charCodeAt(i++)<<16) + (s.charCodeAt(i++)<<8) + s.charCodeAt(i++);
86 | else len = s.length-1;
87 | }
88 |
89 | if(tag==6 || tag==14) // public key/subkey packet
90 | {
91 | var k = i;
92 | var vers=s.charCodeAt(i++);
93 |
94 | found = 1;
95 | this.vers=vers;
96 |
97 | var time=(s.charCodeAt(i++)<<24) + (s.charCodeAt(i++)<<16) + (s.charCodeAt(i++)<<8) + s.charCodeAt(i++);
98 |
99 | if(vers==2 || vers==3) var valid=s.charCodeAt(i++)<<8 + s.charCodeAt(i++);
100 |
101 | var algo=s.charCodeAt(i++);
102 |
103 | if(algo == 1 || algo == 2)
104 | {
105 | var m = i;
106 | var lm = Math.floor((s.charCodeAt(i)*256 + s.charCodeAt(i+1)+7)/8);
107 | i+=lm+2;
108 |
109 | var mod = s.substr(m,lm+2);
110 | var le = Math.floor((s.charCodeAt(i)*256 + s.charCodeAt(i+1)+7)/8);
111 | i+=le+2;
112 |
113 | this.pkey=s2r(s.substr(m,lm+le+4));
114 | this.type="RSA";
115 |
116 | if(vers==3)
117 | {
118 | this.fp='';
119 | this.keyid=s2hex(mod.substr(mod.length-8, 8));
120 | }
121 | else if(vers==4)
122 | {
123 | var pkt = String.fromCharCode(0x99) + String.fromCharCode(len>>8)
124 | + String.fromCharCode(len&255)+s.substr(k, len);
125 | var fp = str_sha1(pkt);
126 | this.fp=s2hex(fp);
127 | this.keyid=s2hex(fp.substr(fp.length-8,8));
128 | }
129 | else
130 | {
131 | this.fp='';
132 | this.keyid='';
133 | }
134 | found = 2;
135 | }
136 | else if((algo == 16 || algo == 20) && vers == 4)
137 | {
138 | var m = i;
139 |
140 | var lp = Math.floor((s.charCodeAt(i)*256 + s.charCodeAt(i+1)+7)/8);
141 | i+=lp+2;
142 |
143 | var lg = Math.floor((s.charCodeAt(i)*256 + s.charCodeAt(i+1)+7)/8);
144 | i+=lg+2;
145 |
146 | var ly = Math.floor((s.charCodeAt(i)*256 + s.charCodeAt(i+1)+7)/8);
147 | i+=ly+2;
148 |
149 | this.pkey=s2r(s.substr(m,lp+lg+ly+6));
150 |
151 | var pkt = String.fromCharCode(0x99) + String.fromCharCode(len>>8)
152 | + String.fromCharCode(len&255)+s.substr(k, len);
153 | var fp = str_sha1(pkt);
154 | this.fp=s2hex(fp);
155 | this.keyid=s2hex(fp.substr(fp.length-8,8));
156 | this.type="ELGAMAL";
157 | found = 3;
158 | }
159 | else
160 | {
161 | i = k + len;
162 | }
163 | }
164 | else if(tag==13) // user id
165 | {
166 | this.user=s.substr(i,len);
167 | i+=len;
168 | }
169 | else
170 | {
171 | i+=len;
172 | }
173 | }
174 | if(found < 2)
175 | {
176 | this.vers = '';
177 | this.fp = '';
178 | this.keyid = '';
179 | if(found == 0)
180 | this.user = "No public key packet found.";
181 | else if(found == 1)
182 | {
183 | this.user = "public key algorithm is " + algo + " not RSA or ELGAMAL.";
184 | }
185 | this.pkey = "";
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/css/theme/uulm-base.css:
--------------------------------------------------------------------------------
1 | /*
2 | Syntax error: Undefined mixin 'radial-gradient'.
3 | on line 3 of css/theme/source/uulm-base.scss, in `radial-gradient'
4 | from line 3 of css/theme/source/uulm-base.scss, in `bodyBackground'
5 | from line 8 of css/theme/source/../template/theme.scss
6 | from line 8 of css/theme/source/uulm-base.scss
7 |
8 | 1: // Background generator
9 | 2: @mixin bodyBackground() {
10 | 3: @include radial-gradient( #bebebe, #f0f0f0 );
11 | 4: }
12 | 5:
13 | 6:
14 | 7: // Theme template ------------------------------
15 | 8: @import "../template/theme";
16 |
17 | Backtrace:
18 | css/theme/source/uulm-base.scss:3:in `radial-gradient'
19 | css/theme/source/uulm-base.scss:3:in `bodyBackground'
20 | css/theme/source/../template/theme.scss:8
21 | css/theme/source/uulm-base.scss:8
22 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:170:in `visit_mixin'
23 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `visit'
24 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:18:in `visit'
25 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:201:in `block (2 levels) in visit_mixin'
26 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:201:in `map'
27 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:201:in `block in visit_mixin'
28 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
29 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:201:in `visit_mixin'
30 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `visit'
31 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:18:in `visit'
32 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
33 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `map'
34 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `visit_children'
35 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
36 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
37 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
38 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `block in visit'
39 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:238:in `visit_rule'
40 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `visit'
41 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:18:in `visit'
42 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:146:in `block in visit_import'
43 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:146:in `map'
44 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:146:in `visit_import'
45 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `visit'
46 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:18:in `visit'
47 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `block in visit_children'
48 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `map'
49 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:53:in `visit_children'
50 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:27:in `block in visit_children'
51 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:39:in `with_environment'
52 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:26:in `visit_children'
53 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `block in visit'
54 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:47:in `visit_root'
55 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/base.rb:37:in `visit'
56 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:18:in `visit'
57 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/visitors/perform.rb:7:in `visit'
58 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/tree/root_node.rb:20:in `render'
59 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/engine.rb:300:in `_render'
60 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/engine.rb:247:in `render'
61 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/plugin/compiler.rb:340:in `update_stylesheet'
62 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/plugin/compiler.rb:202:in `block in update_stylesheets'
63 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/plugin/compiler.rb:200:in `each'
64 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/plugin/compiler.rb:200:in `update_stylesheets'
65 | /usr/lib64/ruby/gems/1.9.1/gems/sass-3.1.21/lib/sass/plugin/compiler.rb:298:in `block in watch'
66 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/multi_listener.rb:86:in `call'
67 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/multi_listener.rb:86:in `on_change'
68 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/multi_listener.rb:95:in `block in initialize_adapter'
69 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/adapter.rb:196:in `call'
70 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/adapter.rb:196:in `report_changes'
71 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/adapter.rb:208:in `poll_changed_dirs'
72 | /usr/lib64/ruby/gems/1.9.1/gems/listen-0.5.2/lib/listen/adapters/linux.rb:48:in `block in start'
73 | */
74 | body:before {
75 | white-space: pre;
76 | font-family: monospace;
77 | content: "Syntax error: Undefined mixin 'radial-gradient'.\A on line 3 of css/theme/source/uulm-base.scss, in `radial-gradient'\A from line 3 of css/theme/source/uulm-base.scss, in `bodyBackground'\A from line 8 of css/theme/source/../template/theme.scss\A from line 8 of css/theme/source/uulm-base.scss\A \A 1: // Background generator\A 2: @mixin bodyBackground() {\A 3: @include radial-gradient( #bebebe, #f0f0f0 );\A 4: }\A 5: \A 6: \A 7: // Theme template ------------------------------\A 8: @import \"../template/theme\";"; }
78 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/sha1.js:
--------------------------------------------------------------------------------
1 | /*
2 | * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
3 | * in FIPS PUB 180-1
4 | * Version 2.1 Copyright Paul Johnston 2000 - 2002.
5 | * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
6 | * Distributed under the BSD License
7 | * See http://pajhome.org.uk/crypt/md5 for details.
8 | */
9 |
10 | /*
11 | * Configurable variables. You may need to tweak these to be compatible with
12 | * the server-side, but the defaults work in most cases.
13 | */
14 | var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
15 | var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
16 | var chrsz = 8; /* bits per input character. 8 - ASCII; 16 - Unicode */
17 |
18 | /*
19 | * These are the functions you'll usually want to call
20 | * They take string arguments and return either hex or base-64 encoded strings
21 | */
22 | function hex_sha1(s){return binb2hex(core_sha1(str2binb(s),s.length * chrsz));}
23 | function b64_sha1(s){return binb2b64(core_sha1(str2binb(s),s.length * chrsz));}
24 | function str_sha1(s){return binb2str(core_sha1(str2binb(s),s.length * chrsz));}
25 | function hex_hmac_sha1(key, data){ return binb2hex(core_hmac_sha1(key, data));}
26 | function b64_hmac_sha1(key, data){ return binb2b64(core_hmac_sha1(key, data));}
27 | function str_hmac_sha1(key, data){ return binb2str(core_hmac_sha1(key, data));}
28 |
29 | /*
30 | * Perform a simple self-test to see if the VM is working
31 | */
32 | function sha1_vm_test()
33 | {
34 | return hex_sha1("abc") == "a9993e364706816aba3e25717850c26c9cd0d89d";
35 | }
36 |
37 | /*
38 | * Calculate the SHA-1 of an array of big-endian words, and a bit length
39 | */
40 | function core_sha1(x, len)
41 | {
42 | /* append padding */
43 | x[len >> 5] |= 0x80 << (24 - len % 32);
44 | x[((len + 64 >> 9) << 4) + 15] = len;
45 |
46 | var w = Array(80);
47 | var a = 1732584193;
48 | var b = -271733879;
49 | var c = -1732584194;
50 | var d = 271733878;
51 | var e = -1009589776;
52 |
53 | for(var i = 0; i < x.length; i += 16)
54 | {
55 | var olda = a;
56 | var oldb = b;
57 | var oldc = c;
58 | var oldd = d;
59 | var olde = e;
60 |
61 | for(var j = 0; j < 80; j++)
62 | {
63 | if(j < 16) w[j] = x[i + j];
64 | else w[j] = rol(w[j-3] ^ w[j-8] ^ w[j-14] ^ w[j-16], 1);
65 | var t = safe_add(safe_add(rol(a, 5), sha1_ft(j, b, c, d)),
66 | safe_add(safe_add(e, w[j]), sha1_kt(j)));
67 | e = d;
68 | d = c;
69 | c = rol(b, 30);
70 | b = a;
71 | a = t;
72 | }
73 |
74 | a = safe_add(a, olda);
75 | b = safe_add(b, oldb);
76 | c = safe_add(c, oldc);
77 | d = safe_add(d, oldd);
78 | e = safe_add(e, olde);
79 | }
80 | return Array(a, b, c, d, e);
81 |
82 | }
83 |
84 | /*
85 | * Perform the appropriate triplet combination function for the current
86 | * iteration
87 | */
88 | function sha1_ft(t, b, c, d)
89 | {
90 | if(t < 20) return (b & c) | ((~b) & d);
91 | if(t < 40) return b ^ c ^ d;
92 | if(t < 60) return (b & c) | (b & d) | (c & d);
93 | return b ^ c ^ d;
94 | }
95 |
96 | /*
97 | * Determine the appropriate additive constant for the current iteration
98 | */
99 | function sha1_kt(t)
100 | {
101 | return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
102 | (t < 60) ? -1894007588 : -899497514;
103 | }
104 |
105 | /*
106 | * Calculate the HMAC-SHA1 of a key and some data
107 | */
108 | function core_hmac_sha1(key, data)
109 | {
110 | var bkey = str2binb(key);
111 | if(bkey.length > 16) bkey = core_sha1(bkey, key.length * chrsz);
112 |
113 | var ipad = Array(16), opad = Array(16);
114 | for(var i = 0; i < 16; i++)
115 | {
116 | ipad[i] = bkey[i] ^ 0x36363636;
117 | opad[i] = bkey[i] ^ 0x5C5C5C5C;
118 | }
119 |
120 | var hash = core_sha1(ipad.concat(str2binb(data)), 512 + data.length * chrsz);
121 | return core_sha1(opad.concat(hash), 512 + 160);
122 | }
123 |
124 | /*
125 | * Add integers, wrapping at 2^32. This uses 16-bit operations internally
126 | * to work around bugs in some JS interpreters.
127 | */
128 | function safe_add(x, y)
129 | {
130 | var lsw = (x & 0xFFFF) + (y & 0xFFFF);
131 | var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
132 | return (msw << 16) | (lsw & 0xFFFF);
133 | }
134 |
135 | /*
136 | * Bitwise rotate a 32-bit number to the left.
137 | */
138 | function rol(num, cnt)
139 | {
140 | return (num << cnt) | (num >>> (32 - cnt));
141 | }
142 |
143 | /*
144 | * Convert an 8-bit or 16-bit string to an array of big-endian words
145 | * In 8-bit function, characters >255 have their hi-byte silently ignored.
146 | */
147 | function str2binb(str)
148 | {
149 | var bin = Array();
150 | var mask = (1 << chrsz) - 1;
151 | for(var i = 0; i < str.length * chrsz; i += chrsz)
152 | bin[i>>5] |= (str.charCodeAt(i / chrsz) & mask) << (24 - i%32);
153 | return bin;
154 | }
155 |
156 | /*
157 | * Convert an array of big-endian words to a string
158 | */
159 | function binb2str(bin)
160 | {
161 | var str = "";
162 | var mask = (1 << chrsz) - 1;
163 | for(var i = 0; i < bin.length * 32; i += chrsz)
164 | str += String.fromCharCode((bin[i>>5] >>> (24 - i%32)) & mask);
165 | return str;
166 | }
167 |
168 | /*
169 | * Convert an array of big-endian words to a hex string.
170 | */
171 | function binb2hex(binarray)
172 | {
173 | var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
174 | var str = "";
175 | for(var i = 0; i < binarray.length * 4; i++)
176 | {
177 | str += hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8+4)) & 0xF) +
178 | hex_tab.charAt((binarray[i>>2] >> ((3 - i%4)*8 )) & 0xF);
179 | }
180 | return str;
181 | }
182 |
183 | /*
184 | * Convert an array of big-endian words to a base-64 string
185 | */
186 | function binb2b64(binarray)
187 | {
188 | var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
189 | var str = "";
190 | for(var i = 0; i < binarray.length * 4; i += 3)
191 | {
192 | var triplet = (((binarray[i >> 2] >> 8 * (3 - i %4)) & 0xFF) << 16)
193 | | (((binarray[i+1 >> 2] >> 8 * (3 - (i+1)%4)) & 0xFF) << 8 )
194 | | ((binarray[i+2 >> 2] >> 8 * (3 - (i+2)%4)) & 0xFF);
195 | for(var j = 0; j < 4; j++)
196 | {
197 | if(i * 8 + j * 6 > binarray.length * 32) str += b64pad;
198 | else str += tab.charAt((triplet >> 6*(3-j)) & 0x3F);
199 | }
200 | }
201 | return str;
202 | }
203 |
--------------------------------------------------------------------------------
/Vortrag_PEP-chat/plugin/notes/notes.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | reveal.js - Slide Notes
7 |
8 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 | UPCOMING:
147 |
148 |
149 |
150 |
151 |
Time
152 | 0:00:00 AM
153 |
154 |
155 |
Elapsed
156 | 00:00:00
157 |
158 |
159 |
160 |
161 |
162 |
163 |
251 |
252 |
253 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/SOAEP.js:
--------------------------------------------------------------------------------
1 | /*
2 | * SOAEP.js
3 | * See SOAEP.readme.txt for further information.
4 | *
5 | * Copyright(c) 2009 Atsushi Oka [ http://oka.nu/ ]
6 | * This script file is distributed under the LGPL
7 | */
8 |
9 | // Sub-Optimal Asymmetric Encryption Padding
10 | function initSOAEP( packages ) {
11 | __unit( "SOAEP.js" );
12 | __uses( "packages.js" );
13 | // __uses( "trace.js" );
14 | // __uses( "elapse.js" );
15 | __uses( "binary.js" );
16 | __uses( "Cipher.js" );
17 | __uses( "SecureRandom.js" );
18 |
19 | var SecureRandom = __import( this,"titaniumcore.crypto.SecureRandom" );
20 | var Cipher = __import( this,"titaniumcore.crypto.Cipher" );
21 |
22 | // var encrypt = Cipher.create( algorithm, Cipher.ENCRYPT, Cipher.ECB, Cipher.NO_PADDING );
23 | // var decrypt = Cipher.create( algorithm, Cipher.DECRYPT, Cipher.ECB, Cipher.NO_PADDING );
24 | // var inputText = dataBytes.concat();
25 | // var cipherText = encrypt.execute( keyBytes, inputText.concat() );
26 | // var outputText = decrypt.execute( keyBytes, cipherText.concat() );
27 |
28 | function SOAEP( random, cipherAlgorithm, withBitPadding ) {
29 | if ( withBitPadding == null ) {
30 | withBitPadding = true;
31 | }
32 | this.random = random == null ? new SecureRandom() : random ;
33 | this.cipherAlgorithm = cipherAlgorithm == null ? Cipher.algorithm( Cipher.TWOFISH ) : cipherAlgorithm;
34 | this.withBitPadding = withBitPadding;
35 | }
36 |
37 | function maxsize( length ){
38 | var blocksize = this.cipherAlgorithm.blocksize;
39 | return length-blocksize + ( this.withBitPadding ? -1 : 0 );
40 | }
41 |
42 |
43 | function encode( input, length ) {
44 | // initialization
45 | var blocksize = this.cipherAlgorithm.blocksize;
46 |
47 | // if length is not specified, calculate the sufficient length for the length of input data.
48 | if ( length == null ) {
49 | length = Math.ceil( (1+input.length) / blocksize ) * blocksize + blocksize;
50 | }
51 | // alert( ""+input.length+"/"+length );
52 |
53 | if ( 0!=(length % blocksize ) ) {
54 | throw "SOAEP.encode() error : length("+length+") must be a multiple of " + blocksize + " since the block size of " + this.cipherAlgorithm.name + " is " +blocksize;
55 | }
56 |
57 | var blockCount = Math.floor( length / blocksize );
58 |
59 | // var maxsize = length - blocksize -1;
60 | var maxsize = this.maxsize( length );
61 |
62 | // trim input data if input data length exceeds the specified length by "length" parameter.
63 | // -1 for the terminater byte.
64 | if ( maxsize < input.length ) {
65 | throw "SOAEP.encode() error : the size of input data (" + input.length + " bytes) must not exceed " + maxsize + "byte. \n"+maxsize+"(maxsize)="+length+"(bit-length of the RSA key )-" + blocksize+"( blocksize of the cipher algorithm)" + ( this.withBitPadding ? "-1(size of the terminator byte)" : "" ) ;
66 | // input = input.slice( 0, length-blocksize -1 );
67 | }
68 |
69 | // Create output array.
70 | var output = new Array( length );
71 |
72 | // Create a random token block. Use it as synmmetoric cipher key later.
73 | var randomized = new Array( blocksize );
74 | this.random.nextBytes( randomized );
75 |
76 | // Copy input text to output
77 | for ( var i=0; i img.header {
245 | position: absolute;
246 | left: 0;
247 | top: 20%;
248 | height: 50%;
249 | width: 100%;
250 | min-height: 50%;
251 | min-width: 100%;
252 | margin: 0;
253 | z-index: -1;
254 | }
255 | .reveal .slides div.title .belowheader {
256 | position: absolute;
257 | top: 70%;
258 | padding-top: 1ex;
259 | }
260 | .reveal .slides div.title .belowheader h1 {
261 | margin: 0;
262 | }
263 | .reveal .slides div.fill {
264 | padding: 20px 60px 32px;
265 | }
266 | .reveal .slides div.fill h2 {
267 | background: rgba(255, 255, 255, 0.75);
268 | padding-top: .2em;
269 | padding-bottom: .3em;
270 | margin-top: .3em;
271 | margin-bottom: .3em;
272 | margin-left: -60px;
273 | padding-left: 60px;
274 | margin-right: -60px;
275 | padding-right: 60px;
276 | }
277 | .reveal .slides div.fill > img {
278 | margin: 0;
279 | border: 0;
280 | border-radius: 10px;
281 | -moz-border-radius: 10px;
282 | position: absolute;
283 | left: 0;
284 | top: 0;
285 | min-height: 100%;
286 | min-width: 100%;
287 | z-index: -1;
288 | }
289 |
290 | .reveal .slides .darkbg {
291 | color: white;
292 | text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5);
293 | }
294 | .reveal .slides .darkbg a {
295 | color: white;
296 | background: rgba(255, 255, 255, 0.2);
297 | }
298 | .reveal .slides .darkbg a:hover {
299 | color: #105291;
300 | background: rgba(255, 255, 255, 0.7);
301 | }
302 |
--------------------------------------------------------------------------------
/PGP-Chat-Server/chat/js/PGencode.js:
--------------------------------------------------------------------------------
1 |
2 | /* OpenPGP encryption using RSA/AES
3 | * Copyright 2005-2006 Herbert Hanewinkel, www.haneWIN.de
4 | * version 2.0, check www.haneWIN.de for the latest version
5 |
6 | * This software is provided as-is, without express or implied warranty.
7 | * Permission to use, copy, modify, distribute or sell this software, with or
8 | * without fee, for any purpose and by any individual or organization, is hereby
9 | * granted, provided that the above copyright notice and this paragraph appear
10 | * in all copies. Distribution as a part of an application or binary must
11 | * include the above copyright notice in the documentation and/or other
12 | * materials provided with the application or distribution.
13 | */
14 |
15 | /* We need an unpredictable session key of 128 bits ( = 2^128 possible keys).
16 | * If we generate the session key with a PRNG from a small seed we get only
17 | * a small number of session keys, e.g. 4 bytes seed => 2^32 keys, a brute
18 | * force attack could try all 2^32 session keys.
19 | * (see RFC 1750 - Randomness Recommendations for Security.)
20 | *
21 | * Sources for randomness in Javascript are limited.
22 | * We have load, exec time, seed from random(), mouse movement events
23 | * and the timing from key press events.
24 | * But even here we have restrictions.
25 | * - A mailer will add a timestamp to the encrypted message, therefore
26 | * only the msecs from the clock can be seen as unpredictable.
27 | * - Because the Windows timer is still based on the old DOS timer,
28 | * the msecs jump under Windows in 18.2 msecs steps.
29 | * - Only a few bits from mouse mouvement event coordinates are unpredictable,
30 | * if the same buttons are clicked on the screen.
31 | */
32 |
33 | var rnArray = new Array(256);
34 | var rnNext = 0;
35 | var rnRead = 0;
36 |
37 | function randomByte() { return Math.round(Math.random()*255)&255; }
38 | function timeByte() { return ((new Date().getTime())>>>2)&255; }
39 |
40 | function rnTimer()
41 | {
42 | var t = timeByte(); // load time
43 |
44 | for(var i=0; i<256; i++)
45 | {
46 | t ^= randomByte();
47 | rnArray[(rnNext++)&255] ^= t;
48 | }
49 | window.setTimeout("rnTimer()",randomByte()|128);
50 | }
51 |
52 | // rnTimer() and mouseMoveCollect() are started on page load.
53 |
54 | rnTimer();
55 | eventsCollect();
56 |
57 | // ----------------------------------------
58 |
59 | function randomString(len, nozero)
60 | {
61 | var r = '';
62 | var t = timeByte(); // exec time
63 |
64 | for(var i=0; i>16)&255)
101 | +String.fromCharCode((crc>>8)&255)
102 | +String.fromCharCode(crc&255);
103 | }
104 |
105 | // --------------------------------------
106 | // GPG CFB symmetric encryption using AES
107 |
108 | var bpbl = 16; // bytes per data block
109 |
110 | function GPGencrypt(key, text)
111 | {
112 | var i, n;
113 | var len = text.length;
114 | var lsk = key.length;
115 | var iblock = new Array(bpbl)
116 | var rblock = new Array(bpbl);
117 | var ct = new Array(bpbl+2);
118 | var expandedKey = new Array();
119 |
120 | var ciphertext = '';
121 |
122 | // append zero padding
123 | if(len%bpbl)
124 | {
125 | for(i=(len%bpbl); i255) tag +=1;
171 | var h = String.fromCharCode(tag);
172 | if(len>255) h+=String.fromCharCode(len/256);
173 | h += String.fromCharCode(len%256);
174 | return h;
175 | }
176 |
177 | // ----------------------------------------------
178 | // GPG public key encryted session key packet (1)
179 |
180 | function GPGpkesk(keyId, keytyp, symAlgo, sessionkey, pkey)
181 | {
182 | var el = [3,5,9,17,513,2049,4097,8193];
183 | var mod=new Array();
184 | var exp=new Array();
185 | var enc='';
186 |
187 | var s = r2s(pkey);
188 | var l = Math.floor((s.charCodeAt(0)*256 + s.charCodeAt(1)+7)/8);
189 |
190 | mod = mpi2b(s.substr(0,l+2));
191 |
192 | if(keytyp)
193 | {
194 | var grp=new Array();
195 | var y =new Array();
196 | var B =new Array();
197 | var C =new Array();
198 |
199 | var l2 = Math.floor((s.charCodeAt(l+2)*256 + s.charCodeAt(l+3)+7)/8)+2;
200 |
201 | grp = mpi2b(s.substr(l+2,l2));
202 | y = mpi2b(s.substr(l+2+l2));
203 | exp[0] = 9; //el[randomByte()&7];
204 | B = bmodexp(grp,exp,mod);
205 | C = bmodexp(y,exp,mod);
206 | }
207 | else
208 | {
209 | exp = mpi2b(s.substr(l+2));
210 | }
211 |
212 | var lsk = sessionkey.length;
213 |
214 | // calculate checksum of session key
215 | var c = 0;
216 | for(var i = 0; i < lsk; i++) c += sessionkey.charCodeAt(i);
217 | c &= 0xffff;
218 |
219 | // create MPI from session key using PKCS-1 block type 02
220 | var lm = (l-2)*8+2;
221 | var m = String.fromCharCode(lm/256)+String.fromCharCode(lm%256)
222 | +String.fromCharCode(2) // skip leading 0 for MPI
223 | +randomString(l-lsk-6,1)+'\0' // add random padding (non-zero)
224 | +String.fromCharCode(symAlgo)+sessionkey
225 | +String.fromCharCode(c/256)+String.fromCharCode(c&255);
226 |
227 | if(keytyp)
228 | {
229 | // add Elgamal encrypted mpi values
230 | enc = b2mpi(B)+b2mpi(bmod(bmul(mpi2b(m),C),mod));
231 |
232 | return GPGpkt(0x84,enc.length+10)
233 | +String.fromCharCode(3)+keyId+String.fromCharCode(16)+enc;
234 | }
235 | else
236 | {
237 | // rsa encrypt the result and convert into mpi
238 | enc = b2mpi(bmodexp(mpi2b(m),exp,mod));
239 |
240 | return GPGpkt(0x84,enc.length+10)
241 | +String.fromCharCode(3)+keyId+String.fromCharCode(1)+enc;
242 | }
243 | }
244 |
245 | // ------------------------------------------
246 | // GPG literal data packet (11) for text file
247 |
248 | function GPGld(text)
249 | {
250 | if(text.indexOf('\r\n') == -1)
251 | text = text.replace(/\n/g,'\r\n');
252 | return GPGpkt(0xAC,text.length+10)+'t'
253 | +String.fromCharCode(4)+'file\0\0\0\0'+text;
254 | }
255 |
256 | // -------------------------------------------
257 | // GPG symmetrically encrypted data packet (9)
258 |
259 | function GPGsed(key, text)
260 | {
261 | var enc = GPGencrypt(key, GPGld(text));
262 | return GPGpkt(0xA4,enc.length)+enc;
263 | }
264 |
265 | // ------------------------------------------------
266 |
267 | function doEncrypt(keyId,keytyp,pkey,text)
268 | {
269 | var symAlg = 7; // AES=7, AES192=8, AES256=9
270 | var kSize = [16,24,32] // key length in bytes
271 |
272 | var keylen = kSize[symAlg-7]; // session key length in bytes
273 |
274 | var sesskey = randomString(keylen,0);
275 | keyId = hex2s(keyId);
276 | var cp = GPGpkesk(keyId,keytyp,symAlg,sesskey,pkey)+GPGsed(sesskey,text);
277 |
278 | return '-----BEGIN PGP MESSAGE-----\nVersion: haneWIN JavascriptPG v2.0\n\n'
279 | +s2r(cp)+'\n='+s2r(crc24(cp))+'\n-----END PGP MESSAGE-----\n';
280 | }
281 |
--------------------------------------------------------------------------------