I hereby claim:
- I am neilmadden on github.
- I am neilmadden (https://keybase.io/neilmadden) on keybase.
- I have a public key ASBcU_6xkYIeml3XZUbGrLB9LgOAcrvKGTZB55p-6JTyogo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| % Functional Programming in Erlang MOOC | |
| % Week 1 assignment submission - Neil Madden | |
| -module(ex). | |
| -export([perimeter/1,area/1,enclose/1,bits/1]). | |
| % Type definitions! Found out Erlang supports these... | |
| -type point() :: {number(), number()}. | |
| -type circle() :: {circle, point(), number()}. | |
| -type rectangle() :: {rectangle, point(), number(), number()}. | |
| -type triangle() :: {triangle, point(), point(), point()}. |
| -module(index). | |
| -export([index_file/1,get_file_contents/1,show_file_contents/1]). | |
| % Used to read a file into a list of lines. | |
| % Example files available in: | |
| % gettysburg-address.txt (short) | |
| % dickens-christmas.txt (long) | |
| % Get the contents of a text file into a list of lines. |
| 0x70000d039000 11:12:31.767 [opensc-pkcs11] ctx.c:792:sc_context_create: =================================== | |
| 0x70000d039000 11:12:31.767 [opensc-pkcs11] ctx.c:793:sc_context_create: opensc version: 0.17.0 | |
| 0x70000d039000 11:12:31.767 [opensc-pkcs11] reader-pcsc.c:815:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=1 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1 | |
| 0x70000d039000 11:12:31.768 [opensc-pkcs11] reader-pcsc.c:1283:pcsc_detect_readers: called | |
| 0x70000d039000 11:12:31.768 [opensc-pkcs11] reader-pcsc.c:1302:pcsc_detect_readers: Probing PC/SC readers | |
| 0x70000d039000 11:12:31.768 [opensc-pkcs11] reader-pcsc.c:1330:pcsc_detect_readers: Establish PC/SC context | |
| 0x70000d039000 11:12:31.768 [opensc-pkcs11] reader-pcsc.c:1242:pcsc_add_reader: Adding new PC/SC reader 'Nitrokey Nitrokey HSM' | |
| 0x70000d039000 11:12:31.768 [opensc-pkcs11] reader-pcsc.c:319:refresh_attributes: Nitrokey Nitrokey HSM check | |
| 0x70000d039000 11:12:31.769 [opensc-pkcs11] reader-pcsc.c:347:refresh_attr |
| const crypto = window.crypto.subtle; | |
| const UTF8 = new TextEncoder('utf-8'); | |
| function genKeyPair() { | |
| return crypto.generateKey({ | |
| name: "ECDH", | |
| namedCurve: "P-256" | |
| }, false, ['deriveKey', 'deriveBits']); | |
| } |
| // Shared context of the request: | |
| String accessToken = "an_access_token"; | |
| String origin = "https://api.example.com:443"; | |
| JweHeader header = new JweHeader(); | |
| header.setAgreementPartyUInfo(Base64url.encode(accessToken)); | |
| header.setAgreementPartyVInfo(Base64url.encode(origin)); | |
| // Server - generate challenge | |
| OkpJWK ephemeral = OkpJWK.generateKeyPair(X25519); | |
| String challenge = Base64url.encode(ephemeral.toPublicJwk().get().toJsonValue().toString()); |
| #!/usr/bin/env python3 | |
| # Copyright 2024 Neil Madden. | |
| # License: https://creativecommons.org/licenses/by-sa/4.0/deed.en. | |
| # Like this? I do training courses & consultancy: | |
| # https://illuminated-security.com/ | |
| import hashlib | |
| import math | |
| import os |