commit be8b2894c102af3d9181df328e87b772f6b0e370
Author: ffff:12.186.22.250 <ffff:12.186.22.250@hub.scroll.pub> Date: 2024-12-24 20:09:44 +0000 Subject: updated claude.html diff --git a/claude.html b/claude.html index e69de29..cf24284 100644 --- a/claude.html +++ b/claude.html @@ -0,0 +1,189 @@ +<!doctype html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <title>Message Signer</title> + <style> + body { + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, + sans-serif; + max-width: 800px; + margin: 20px auto; + padding: 0 20px; + line-height: 1.6; + } + + .container { + background: #f5f5f5; + padding: 20px; + border-radius: 8px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + } + + .form-group { + margin-bottom: 20px; + } + + label { + display: block; + margin-bottom: 5px; + font-weight: bold; + } + + textarea { + width: 100%; + padding: 8px; + border: 1px solid #ddd; + border-radius: 4px; + font-family: monospace; + margin-bottom: 10px; + } + + button { + background: #007aff; + color: white; + border: none; + padding: 10px 20px; + border-radius: 4px; + cursor: pointer; + font-size: 16px; + } + + button:hover { + background: #0056b3; + } + + #status { + margin-top: 20px; + padding: 10px; + border-radius: 4px; + } + + .success { + background: #d4edda; + color: #155724; + } + + .error { + background: #f8d7da; + color: #721c24; + } + + .message-box { + height: 100px; + } + + .key-box { + height: 200px; + } + + .signature-box { + height: 100px; + } + </style> + </head> + <body> + <div class="container"> + <h1>Message Signer</h1> + + <div class="form-group"> + <label for="message">Message:</label> + <textarea + id="message" + class="message-box" + placeholder="Enter your message here" + ></textarea> + </div> + + <div class="form-group"> + <label for="privateKey">Private Key (PEM format):</label> + <textarea + id="privateKey" + class="key-box" + placeholder="Paste your private key here (including BEGIN and END lines)" + ></textarea> + </div> + + <button onclick="signMessage()">Sign Message</button> + + <div class="form-group" id="signatureSection" style="display: none"> + <label for="signature">Signature (Base64):</label> + <textarea id="signature" class="signature-box" readonly></textarea> + </div> + + <div id="status"></div> + </div> + + <script> + async function signMessage() { + const message = document.getElementById("message").value; + const privateKeyPEM = document.getElementById("privateKey").value; + const statusDiv = document.getElementById("status"); + const signatureSection = document.getElementById("signatureSection"); + const signatureTextarea = document.getElementById("signature"); + + try { + // Extract the base64-encoded key material + const pemHeader = "-----BEGIN PRIVATE KEY-----"; + const pemFooter = "-----END PRIVATE KEY-----"; + const pemContents = privateKeyPEM + .substring( + privateKeyPEM.indexOf(pemHeader) + pemHeader.length, + privateKeyPEM.indexOf(pemFooter), + ) + .replace(/\s/g, ""); + + // Convert base64 to binary + const binaryDer = str2ab(atob(pemContents)); + + // Import the key + const cryptoKey = await window.crypto.subtle.importKey( + "pkcs8", + binaryDer, + { + name: "RSASSA-PKCS1-v1_5", + hash: "SHA-256", + }, + false, + ["sign"], + ); + + // Sign the message + const encoder = new TextEncoder(); + const data = encoder.encode(message); + const signature = await window.crypto.subtle.sign( + "RSASSA-PKCS1-v1_5", + cryptoKey, + data, + ); + + // Convert to base64 + const signatureBase64 = btoa( + String.fromCharCode(...new Uint8Array(signature)), + ); + + signatureSection.style.display = "block"; + signatureTextarea.value = signatureBase64; + + statusDiv.className = "success"; + statusDiv.textContent = "Message signed successfully!"; + } catch (error) { + statusDiv.className = "error"; + statusDiv.textContent = `Error signing message: ${error.message}`; + signatureSection.style.display = "none"; + } + } + + // Helper function to convert string to ArrayBuffer + function str2ab(str) { + const buf = new ArrayBuffer(str.length); + const bufView = new Uint8Array(buf); + for (let i = 0, strLen = str.length; i < strLen; i++) { + bufView[i] = str.charCodeAt(i); + } + return buf; + } + </script> + </body> +</html>
commit 2c04f269aa2df2902cefa54253c22a93162fccc9
Author: ffff:12.186.22.250 <ffff:12.186.22.250@hub.scroll.pub> Date: 2024-12-24 20:09:38 +0000 Subject: created claude.html diff --git a/claude.html b/claude.html new file mode 100644 index 0000000..e69de29
commit 456e691b9dd25ae052c332d189296c549d80a6cb
Author: ffff:12.186.22.250 <ffff:12.186.22.250@hub.scroll.pub> Date: 2024-12-24 20:09:32 +0000 Subject: updated index.scroll diff --git a/index.scroll b/index.scroll index 4442ed6..f2115ea 100644 --- a/index.scroll +++ b/index.scroll @@ -1,4 +1,2 @@ buildHtml -theme roboto - -Hello World my name is \ No newline at end of file +claude.html \ No newline at end of file
commit fda54dbff1d85c5169aabaa592b849be690002f2
Author: ffff:12.186.22.250 <ffff:12.186.22.250@hub.scroll.pub> Date: 2024-12-22 18:15:33 +0000 Subject: updated .gitignore diff --git a/.gitignore b/.gitignore index bd1a52d..43b9694 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ *.css *.js *.csv +.* requests.scroll \ No newline at end of file
commit 93e43037b7794c5d3de89eaf6afe3e3d561d8df3
Author: root <root@hub.scroll.pub> Date: 2024-11-10 20:12:15 +0000 Subject: initial blank_template template diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bd1a52d --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +*.html +*.txt +*.xml +*.css +*.js +*.csv +requests.scroll \ No newline at end of file diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..4442ed6 --- /dev/null +++ b/index.scroll @@ -0,0 +1,4 @@ +buildHtml +theme roboto + +Hello World my name is \ No newline at end of file