Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F104615349
example.html
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Mar 10, 22:12
Size
841 B
Mime Type
text/html
Expires
Wed, Mar 12, 22:12 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24823246
Attached To
R4897 i2b2-webclient
example.html
View Options
<meta
charset=
"UTF-8"
>
<head>
<title>
JS encryption tests
</title>
<script
type=
"text/javascript"
src=
"crypto_javascript.js"
></script>
<script>
var
pk
,
sk
;
var
cipher
,
plain
;
function
genkey
(){
[
sk
,
pk
]
=
GenKey
()
// alert("Secret key: " + sk + "\nPrivate key: " + pk)
}
function
encrypt
(){
cipher
=
EncryptInt
(
pk
,
99999
)
// alert("Cipher: " + cipher)
}
function
decrypt
()
{
plain
=
DecryptInt
(
cipher
,
sk
);
alert
(
"Plaintext: "
+
plain
)
}
</script>
</head>
<body>
<input
type=
"button"
onclick=
"genkey()"
value=
"gen key"
>
<input
type=
"button"
onclick=
"encrypt()"
value=
"encrypt 5000"
>
<input
type=
"button"
onclick=
"decrypt()"
value=
"decrypt"
>
<input
type=
"button"
onclick=
"genkey();encrypt();decrypt()"
value=
"all"
>
<!--<input type="button" onclick="MyPrint()" value="print">-->
</body>
</html>
Event Timeline
Log In to Comment