Skip to content

Instantly share code, notes, and snippets.

View Zenithar's full-sized avatar

Thibault NORMAND Zenithar

View GitHub Profile
@Zenithar
Zenithar / mastodon.yml
Created April 10, 2017 09:52
OpenAPI / Swagger Mastodon API Specification
swagger: '2.0'
info:
title: Mastodon API
description: API for GNU Social-compatible microblogging server
version: '1.1.1'
contact:
name: Mastodon API Team
url: https://github.com/tootsuite/mastodon
license:
name: AGPL
@Zenithar
Zenithar / hperf.go
Last active February 27, 2024 15:53
Run hash function benchmark on 1GB file content.
package main
import (
"crypto"
"regexp"
"testing"
_ "crypto/sha256"
_ "crypto/sha512"
@Zenithar
Zenithar / dnscrypt-proxy
Last active January 29, 2024 17:42
Unbound + DNSCrypt configuration
DNSCRYPT_LOCALIP=127.0.0.1
DNSCRYPT_LOCALIP2=127.0.0.2
DNSCRYPT_LOCALPORT=9053
DNSCRYPT_RESOLVERPORT=443
DNSCRYPT_USER=nobody
DNSCRYPT_PROVIDER_NAME=2.dnscrypt-cert.resolver2.dnscrypt.eu
DNSCRYPT_PROVIDER_NAME2=2.dnscrypt-cert.resolver1.dnscrypt.eu
DNSCRYPT_PROVIDER_KEY=3748:5585:E3B9:D088:FD25:AD36:B037:01F5:520C:D648:9E9A:DD52:1457:4955:9F0A:9955
DNSCRYPT_PROVIDER_KEY2=67C0:0F2C:21C5:5481:45DD:7CB4:6A27:1AF2:EB96:9931:40A3:09B6:2B8D:1653:1185:9C66
DNSCRYPT_RESOLVERIP=77.66.84.233
package main
import (
"crypto/ecdh"
"crypto/rand"
"crypto/sha256"
"fmt"
"io"
"os"
@Zenithar
Zenithar / gojson_tranform.go
Created November 24, 2023 14:50
Transform JSON with GO
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"time"
@Zenithar
Zenithar / eccompressor.go
Last active October 12, 2023 10:17
Provide CP-256, CP-384, CP-521 Y point resolution from an OKP serialized X point - https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-dnhpke-02#section-4.1.1
package main
import (
"crypto/elliptic"
"encoding/hex"
"fmt"
"math/big"
)
// https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-dnhpke-02#section-4.1.1
@Zenithar
Zenithar / dhkem.go
Last active October 9, 2023 16:10
This is an implementation of DHKEM described in RFC9180 - https://datatracker.ietf.org/doc/rfc9180/
package dhkem
import (
"crypto/ecdh"
"crypto/rand"
"encoding/binary"
"errors"
"fmt"
"hash"
"io"
@Zenithar
Zenithar / pinned_dialer.go
Last active October 3, 2023 07:12
Pinned TLS Dialer for Go
package main
import (
"context"
"crypto/sha256"
"crypto/subtle"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/asn1"
package main
import (
"crypto/hmac"
"crypto/rand"
"crypto/sha256"
"crypto/subtle"
"encoding/binary"
"encoding/hex"
"fmt"
@Zenithar
Zenithar / zkpauth.go
Last active September 16, 2023 17:46
SMP / ZKP based secure comparison for authentication purpose.
package main
import (
"crypto/ed25519"
"crypto/rand"
"crypto/sha512"
"encoding/hex"
"errors"
"fmt"
"io"