<commit_before><!DOCTYPE html>
<meta charset="utf-8">
<title>zwrite.js proof of concept</title>

<script src="q.min.js"></script>
<script src="sjcl.js"></script>
<script src="util.js"></script>
<script src="crypto-js/rollups/tripledes.js"></script>
<script src="crypto-js/components/pad-nopadding-min.js"></script>
<script src="crc32.js"></script>
<script src="asn1.js"></script>
<script src="krb.js"></script>
<script src="kcrypto.js"></script>
<script src="kdc.js"></script>
<script src="winchan.js"></script>

<h1>zwrite.js proof of concept</h1>

<p>(Sorry, this apparently only works in WebKit right now. The <a href="http://crypto.stanford.edu/sjcl/">SJCL</a> stuff
to get around lack of <code><a href="https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues">window.crypto.getRandomValues</a></code>
doesn't work in invisible iframes. For now try it in Chrome or something.)</p>

<form id="z-form">
  Class: <input id="z-class" autofocus placeholder="message"><br>
  Instance: <input id="z-inst" placeholder="personal"><br>
  Recipient: <input id="z-recip"><br>
  <textarea id="z-message" rows=10 cols=80></textarea><br>
  <input type="submit" value="Send">
</form>

<p>
zwrite.js obtains a ticket for <code>zephyr/<EMAIL></code>
through <a href="https://webathena.mit.edu">Webathena</a>. It then
assembles the notice itself (after querying the server to find out its IP) and
forwards to <code>zhm.cgi</code> which just forwards it along to its local zhm.
The page is protected by certificates for now to prevent potential abuse of the
zhm proxy; it's possible that a real web-based zephyr client will want more
sanity checking on the proxy. Perhaps independent authentication (through
something less evil than SSL client auth) and stuff. I dunno.
</p>

<p>
Note: you have to be already "logged in" to Webathena for this to work. We
haven't written any UI for forwarding tickets between origins yet.
</p>
<script>
    var Z_MAXPKTLEN = 1024;
    var Z_FRAGFUDGE = 13;

    // A lot of this is lifted basically straight from pykrb5's zwrite.py.<commit_msg>Update zwrite-js text<commit_after><!DOCTYPE html>
<meta charset="utf-8">
<title>zwrite.js proof of concept</title>

<script src="q.min.js"></script>
<script src="sjcl.js"></script>
<script src="util.js"></script>
<script src="crypto-js/rollups/tripledes.js"></script>
<script src="crypto-js/components/pad-nopadding-min.js"></script>
<script src="crc32.js"></script>
<script src="asn1.js"></script>
<script src="krb.js"></script>
<script src="kcrypto.js"></script>
<script src="kdc.js"></script>
<script src="winchan.js"></script>

<h1>zwrite.js proof of concept</h1>

<p>(Sorry, this works best in WebKit right now. The <a href="http://crypto.stanford.edu/sjcl/">SJCL</a> stuff
to get around lack of <code><a href="https://developer.mozilla.org/en/DOM/window.crypto.getRandomValues">window.crypto.getRandomValues</a></code>
requires jiggling the mouse a lot. For now try it in Chrome or something.)</p>

<form id="z-form">
  Class: <input id="z-class" autofocus placeholder="message"><br>
  Instance: <input id="z-inst" placeholder="personal"><br>
  Recipient: <input id="z-recip"><br>
  <textarea id="z-message" rows=10 cols=80></textarea><br>
  <input type="submit" value="Send">
</form>

<p>
zwrite.js obtains a ticket for <code>zephyr/<EMAIL></code>
through <a href="https://webathena.mit.edu">Webathena</a>. It then
assembles the notice itself (after querying the server to find out its IP) and
forwards to <code>zhm.cgi</code> which just forwards it along to its local zhm.
The page is protected by certificates for now to prevent potential abuse of the
zhm proxy; it's possible that a real web-based zephyr client will want more
sanity checking on the proxy. Perhaps independent authentication (through
something less evil than SSL client auth) and stuff. I dunno.
</p>
<script>
    var Z_MAXPKTLEN = 1024;
    var Z_FRAGFUDGE = 13;

    // A lot of this is lifted basically straight from pykrb5's zwrite.py.
{'fraction_non_alphanumeric': 0.15467535723238907, 'fraction_numerical': 0.008523439458510905, 'mean_word_length': 5.073059360730594, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 121, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1181130', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1315, 'n_words': 414}