Commit 07a92fa3 authored by marcus-tun's avatar marcus-tun
Browse files

added experimental support for twofish

parent 1259826f
......@@ -82,22 +82,38 @@ function base64_encode(data) {
}
assertion = httpGet("https://saml-delegation.data.kit.edu/sd/ecp.py")
/*
*document.write(assertion);
*/
// Create a key for encryption
var message="thisis a test.thisis a test.thisis a test.thisis a test.thisis a test.";
var tf = new twoFish;
random_a = Math.random();
Math.seedrandom('xsdf'+random_a);
random_a = Math.random();
Math.seedrandom('xsdf'+random_a);
key_a = Math.random();
counter = 0;
// wait for a random time before we create the 2nd key
for (var i = Math.round(10000000*random_a); i > 0; i--) {
}
key_b = Math.random();
key = 1e17*key_a+"-"+1e17*key_b;
// encrypt assertion
encrypted_assertion= tf.encrypt(key, assertion);
// encode assertion
//b64assertion = encode64(assertion);
b64assertion = base64_encode(assertion);
//document.write(b64assertion);
//document.write('<br/>\n\n<br/>');
//document.write(assertion);
b64assertion = base64_encode(encrypted_assertion);
document.write(b64assertion)
for (var i = Math.round(1000000000); i > 0; i--) {
}
url = post("https://saml-delegation.data.kit.edu/sd/jsupload.py", {encrypted_assertion: b64assertion});
//response = post("https://saml-delegation.data.kit.edu/sd/jsupload.py", {encrypted_assertion: assertion});
document.write('You can use this url as a temporary password in all federation-enabled services:<br/>');
document.write(url)
document.write(url+"--"+key)
for (var i = Math.round(1000000000); i > 0; i--) {
}
......@@ -46,13 +46,14 @@ def handler(req):
</html>'''% req.uri)
return apache.OK
# sso via javascript
# js: sso via javascript
if location == 'js.py':
req.content_type = 'text/html'
req.write('''<!DOCTYPE html>
<html>
<head>
<script src="js/twofish/2-fish.js"> </script>
<script src="js/seedrandom/seedrandom.min.js"> </script>
</head>
<body>
<script type="text/javascript">''')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment