Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
marcus.hardt
pluto
Commits
738e0818
Commit
738e0818
authored
Sep 26, 2014
by
marcus-tun
Browse files
temporary commit to start playing with blowfish and proper submit
parent
01df3306
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/js.js
View file @
738e0818
...
...
@@ -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
=
1
e17
*
key_a
+
"
-
"
+
1
e17
*
key_b
;
document
.
write
(
"
<br/>
"
+
key
+
"
<br/>
"
);
document
.
write
(
'
<br/>
\n
5
'
);
// 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/>
\n
8
'
);
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
--
)
{
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment