33 Commits

Author SHA1 Message Date
Oliver Falk
aa6d9945af Merge branch 'devel' into redesign 2022-02-18 14:02:52 +01:00
Oliver Falk
3e43deff9d Merge branch 'devel' into redesign 2021-09-16 13:36:14 +02:00
Oliver Falk
c13de44e0f Merge branch 'devel' into redesign 2021-09-10 13:02:27 +02:00
Oliver Falk
1e32c5ee84 Merge branch 'devel' into redesign 2021-09-10 11:27:36 +02:00
Oliver Falk
3484122ce1 Merge branch 'devel' into redesign 2020-11-13 13:56:05 +01:00
Lukas Schönsgibl
00e3c67a6e change view if just one confirmed openid or confirmed emailaccount 2020-10-21 06:58:57 +02:00
Lukas Schönsgibl
414d1125a2 fix hover on mobile profile page 2020-10-21 06:35:15 +02:00
Lukas Schönsgibl
25b0d59e51 Merge branch 'redesign' of https://git.linux-kernel.at/oliver/ivatar into redesign 2020-10-21 06:25:32 +02:00
Oliver Falk
aaf5fd6a01 Merge branch 'redesign' of git.linux-kernel.at:oliver/ivatar into redesign 2020-10-19 11:21:14 +02:00
Oliver Falk
73dcf70287 Add some space between buttons and ID 2020-10-19 11:21:01 +02:00
Lukas Schönsgibl
c00979c0ae js typo 2020-10-17 08:42:05 +02:00
Lukas Schönsgibl
22b4e5224f mobile polish profile page 2020-10-17 08:33:09 +02:00
Lukas Schönsgibl
8fcd64d20c grid width profile page 2020-10-13 16:01:55 +02:00
Lukas Schönsgibl
f7476ca700 dimension libravatar nobody pic 2020-10-13 15:24:23 +02:00
Oliver Falk
d861fc315a No longer shorten the OpenID URL 2020-10-13 15:14:07 +02:00
Lukas Schönsgibl
bfdbb8393e css style alert message 2020-10-12 20:52:59 +02:00
Lukas Schönsgibl
71a3fc0f81 active top line 2020-10-12 20:35:47 +02:00
Lukas Schönsgibl
e1882a9515 hover active profile 2020-10-12 20:32:51 +02:00
Lukas Schönsgibl
37382700ec mobile optimization 2020-10-11 05:12:37 +02:00
Lukas Schönsgibl
0519da3262 optimize profile view fordisabled javascript 2020-10-11 05:00:26 +02:00
Lukas Schönsgibl
34a6d26b3e more opacity background active container 2020-10-10 20:58:35 +02:00
Lukas Schönsgibl
5aac1a42aa active class on profile 2020-10-10 20:56:17 +02:00
Lukas Schönsgibl
849a5f28f8 max 80px img 2020-10-10 08:36:30 +02:00
Lukas Schönsgibl
2b5c01847b styling for openID 2020-10-10 08:25:02 +02:00
Lukas Schönsgibl
84557711e5 change setup profile on email 2020-10-10 08:23:03 +02:00
Lukas Schönsgibl
7d9ded3644 hover pure css style 2020-10-07 17:37:56 +02:00
Lukas Schönsgibl
d5294cd8c7 font weight 2020-10-07 08:17:20 +02:00
Lukas Schönsgibl
aace95962c grey/black coloring profile page 2020-10-07 07:59:20 +02:00
Lukas Schönsgibl
539f3a98ac alert text debug 2020-10-07 07:01:56 +02:00
Lukas Schönsgibl
eddeb9028f base setup grid profile page 2020-10-07 06:58:54 +02:00
Lukas Schönsgibl
95776f120b grid style first profile page site 2020-10-06 21:48:12 +02:00
Lukas Schönsgibl
a6b8245ec3 profile page grid style 2020-10-06 20:16:52 +02:00
Lukas Schönsgibl
669f0bf71e add .DSStore into gitignore 2020-10-06 11:10:30 +02:00
6 changed files with 0 additions and 220 deletions

View File

@@ -1,8 +0,0 @@
The code in here should be able to help to build up some encrypting proxy.
If your app uses a lot of libravatar and therefore has to do a lot of DNS
lookups, change your app in such a way, that it encodes the mail address,
sends it over to the proxy, which will decrypt it, do the DNS lookup and
return the image binary.
No guarantee for this code. It's untested and just provided as example.

View File

@@ -1,90 +0,0 @@
<?php
/**
* Valid encryption methods AES-256-CFB
* Code kindly borrowed from:
* https://github.com/arajapandi/php-python-encrypt-decrypt
*
* $cypher = new MyCypher($iv);
* $php_encrypted = $cypher->encrypt('test');
* $php_decrypted = $cypher->decrypt($php_encrypted);
*/
class MyCypher {
private $key = 'asdfa923aksadsYahoasdw998sdsads';
private $iv = null;
private $method = "AES-256-CFB";
private $blocksize = 32;
private $padwith = '`';
/*
* construct for cypher class - get, set key and iv
*/
function __construct($iv, $key = null) {
if (is_string($key)) {
$this->key = $key;
}
$this->iv = $iv;
}
/*
* get hased key - if key is not set on init, then default key wil be used
*/
private function getKEY() {
if (empty($this->key)) {
die('Key not set!');
}
return substr(hash('sha256', $this->key), 0, 32);
}
/*
* get hashed IV value - if no IV values then it throw error
*/
private function getIV() {
if (empty($this->iv)) {
die('IV not set!');
}
return substr(hash('sha256', $this->iv), 0, 16);
}
/*
* Encrypt given string using AES encryption standard
*/
public function encrypt($secret) {
try {
$padded_secret = $secret . str_repeat($this->padwith, ($this->blocksize - strlen($secret) % $this->blocksize));
$encrypted_string = openssl_encrypt($padded_secret, $this->method, $this->getKEY(), OPENSSL_RAW_DATA, $this->getIV());
$encrypted_secret = base64_encode($encrypted_string);
return $encrypted_secret;
} catch (Exception $e) {
die('Error : ' . $e->getMessage());
}
}
/*
* Decrypt given string using AES standard
*/
public function decrypt($secret) {
try {
$decoded_secret = base64_decode($secret);
$decrypted_secret = openssl_decrypt($decoded_secret, $this->method, $this->getKEY(), OPENSSL_RAW_DATA, $this->getIV());
return rtrim($decrypted_secret, $this->padwith);
} catch (Exception $e) {
die('Error : ' . $e->getMessage());
}
}
}

View File

@@ -1,73 +0,0 @@
#!/usr/bin/env python2
#encoding: UTF-8
# Code kindly borrowed from:
# https://github.com/arajapandi/php-python-encrypt-decrypt
# Python Class for AES encryption
"""
Example Usage
enc_str = cipher.encrypt('secret')
enc_str = cipher.decrypt(enc_str)
print(enc_str); #secret
"""
from Crypto.Cipher import AES
import base64
import hashlib
import sys
class MyCypher:
# Default Key for encryption
rawkey = 'asdfa923aksadsYahoasdw998sdsads'
method = AES.MODE_CFB
blocksize = 32 # 16, 32..etc
padwith = '`'.encode('utf-8') # padding value for string
#lambda function for padding
pad = lambda self, s: s + (self.blocksize - len(s) % self.blocksize) * self.padwith
"""
construct for cypher class - get, set key and iv
"""
def __init__(self, iv, key=''):
if(not key):
key = self.rawkey
self.key = key.encode('utf-8')
self.iv = iv.encode('utf-8')
"""
get hased key - if key is not set on init, then default key wil be used
"""
def getKEY(self):
if(not self.key):
sys.exit()
return hashlib.sha256(self.key).hexdigest()[:32]
"""
get hashed IV value - if no IV values then it throw error
"""
def getIV(self):
if(not self.iv):
sys.exit()
self.iv = self.iv
return hashlib.sha256(self.iv).hexdigest()[:16]
"""
Encrypt given string using AES encryption standard
"""
def encrypt(self, raw):
cipher = AES.new(self.getKEY(), self.method, self.getIV(), segment_size=128)
return base64.b64encode(cipher.encrypt(self.pad(raw)))
"""
Decrypt given string using AES standard
"""
def decrypt(self, encrypted):
encrypted = base64.b64decode(encrypted)
cipher = AES.new(self.getKEY(), self.method, self.getIV(), segment_size=128)
return cipher.decrypt(encrypted).rstrip(self.padwith)

View File

@@ -1,32 +0,0 @@
#!/usr/bin/env python3
import urllib.request
import sys
import os
from lib.MyCypher import MyCypher
import libravatar
# Both need to be the same as in your client code that encrypts the
# mail address
iv = 'asdf'
key = 'Hallo123'
#sys.stderr.buffer.write(b'%s' % bytes(os.environ.get("QUERY_STRING", "No Query String in url"), 'utf-8'))
cypher = MyCypher(iv = iv, key = key)
mail = cypher.decrypt(os.environ.get('QUERY_STRING').encode('utf-8')).decode('utf-8')
link = libravatar.libravatar_url(mail)
sys.stderr.buffer.write(b'%s' % bytes(link, 'utf-8'))
data = None
with urllib.request.urlopen(link) as f:
data = f.read()
for header in f.headers._headers:
if header[0] == 'Content-Type':
sys.stdout.buffer.write(b"%s: %s\n\n" % (bytes(header[0], 'utf-8'), bytes(header[1], 'utf-8')))
sys.stdout.flush()
break
sys.stdout.buffer.write(data)

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env python
from MyCypher import MyCypher
encstr = bytes('drEN/LqPBu1wJYHpN5eCjZXqVgvDEP3rZnXJt85Ma0k=', 'utf-8')
cypher = MyCypher(iv = str('asdf'))
print(cypher.decrypt(encstr))

View File

@@ -1,8 +0,0 @@
<?php
include 'lib/MyCypher.php';
$iv = 'asdf';
$key = 'Hallo123';
$cypher = new MyCypher($iv=$iv, $key=$key);
$php_encrypted = $cypher->encrypt('oliver@linux-kernel.at');
print($php_encrypted);