Commit 738e0818 authored by marcus-tun's avatar marcus-tun
Browse files

temporary commit to start playing with blowfish and proper submit

parent 01df3306
......@@ -82,9 +82,7 @@ function base64_encode(data) {
}
assertion = httpGet("https://saml-delegation.data.kit.edu/sd/ecp.py")
// 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);
......@@ -97,23 +95,32 @@ for (var i = Math.round(10000000*random_a); i > 0; i--) {
}
key_b = Math.random();
key = 1e17*key_a+"-"+1e17*key_b;
document.write("<br/>"+key+"<br/>");
document.write('<br/>\n5');
// encrypt assertion
encrypted_assertion= tf.encrypt(key, assertion);
var tf = new twoFish;
encrypted_assertion = tf.encrypt(key, assertion);
//document.write(encrypted_assertion);
// encode assertion
b64assertion = base64_encode(encrypted_assertion);
b64assertion = base64_encode(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});
//encrypted_assertion = "this is a test";
//b64assertion = base64_encode(btoa(encrypted_assertion));
//document.write("<br/>\n"+b64assertion+"<br/>\n");
b64assertion = btoa(encrypted_assertion);
document.write("<br/>\n"+b64assertion);
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('<br/>\n8');
document.write('You can use this url as a temporary password in all federation-enabled services:<br/>');
document.write(url+"--"+key)
for (var i = Math.round(1000000000); i > 0; i--) {
}
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