Skip to content

Instantly share code, notes, and snippets.

View Zenithar's full-sized avatar

Thibault NORMAND Zenithar

View GitHub Profile
// Copyright (C) 2020-2023 by Thibault NORMAND <me+oss@zenithar.org>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as
// defined by the Mozilla Public License, version 2.0.
package idmask
@Zenithar
Zenithar / threatserver.go
Last active June 29, 2022 13:52
Threat test server - This server implements common attacks when your product needs to request external HTTP server.
package main
import (
"encoding/json"
"fmt"
"net/http"
"time"
)
// -----------------------------------------------------------------------------
@Zenithar
Zenithar / ib-kem.go
Last active November 16, 2020 09:48
Key Encapsulation Mechanism exploration for Identity Based derivation. (No warranty) #Kyber #KEM #X25519
// MIT License
//
// Copyright (c) 2020 Thibault Normand
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@Zenithar
Zenithar / ibe.txt
Last active March 13, 2022 15:42
Sample Identity Based Encryption (IBE) in Go using NaCL (No Warranty)
A> Generate ephemeral encryption keypair
A> Bob Identity: harp:v1:identity:nH01kx0xukWDuji3hwNNslj_2YKvp0TdnAB6OPzR1B4:1605982091
A> mPk[Alice => Bob] => KEK: 1TyRX0Azt-w3bsy6bvSJ26StzFvp92PC8FFV_YEQSVY
A> Generate DEK
A> Encrypt [Msg] with DEK
A> Encrypt DEK with KEK
A> Send to bob [MasterPub || ts || EphPub || enc(DEK, KEK) || enc(Msg, DEK)]
B> Extract MasterPub, ts and Ephemeral Encryption Public key
B> Authenticate to PKG
package main
import (
"bytes"
"crypto/ecdsa"
"crypto/sha256"
"encoding/base64"
"encoding/binary"
"encoding/json"
"fmt"
@Zenithar
Zenithar / disable-ipv6.sh
Created June 16, 2020 09:40 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@Zenithar
Zenithar / Archlinux-EFI-LUKS2-LVM2-BTRFS-Systemd.md
Last active November 16, 2022 12:52
Tutorial d'installation Archlinux sur un SSD (NVMe) avec EFI / LUKS2 / LVM2 / BTRFS et systemd-boot comme chargeur de démarrage.

section: post date: "2020-04-12" title: "Archlinux sur un SSD avec EFI / LUKS2 / LVM2 / BTRFS" description: "Procédure d'installation d'Archlinux mise à jour et modernisée" slug: archlinux-efi-ssd-luks2-lvm2-btrfs tags:

  • linux
  • devops
  • luks2

Password Merger

Small tools to generate password and merge from a stdin given template.

Usage

From commandline

@Zenithar
Zenithar / okta_exporter.go
Created November 29, 2019 07:21
Okta user list CSV exporter
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@Zenithar
Zenithar / main.go
Last active October 28, 2019 08:48
// Copyright 2019 Thibault NORMAND
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,