Skip to content

Instantly share code, notes, and snippets.

Avatar

Thibault NORMAND Zenithar

View GitHub Profile
@Zenithar
Zenithar / ib-kem.go
Last active Nov 16, 2020
Key Encapsulation Mechanism exploration for Identity Based derivation. (No warranty) #Kyber #KEM #X25519
View ib-kem.go
// 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 Nov 14, 2020
Sample Identity Based Encryption (IBE) in Go using NaCL (No Warranty)
View ibe.txt
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
View ecdh-1pu-jwt.go
package main
import (
"bytes"
"crypto/ecdsa"
"crypto/sha256"
"encoding/base64"
"encoding/binary"
"encoding/json"
"fmt"
@Zenithar
Zenithar / disable-ipv6.sh
Created Jun 16, 2020 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
View disable-ipv6.sh
#!/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 Aug 16, 2021
Tutorial d'installation Archlinux sur un SSD (NVMe) avec EFI / LUKS2 / LVM2 / BTRFS et systemd-boot comme chargeur de démarrage.
View Archlinux-EFI-LUKS2-LVM2-BTRFS-Systemd.md

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
View README.md

Password Merger

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

Usage

From commandline

@Zenithar
Zenithar / okta_exporter.go
Created Nov 29, 2019
Okta user list CSV exporter
View okta_exporter.go
//
// 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.
View main.go
// 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,
@Zenithar
Zenithar / id.go
Last active May 14, 2019
How I write microservice (part 2)
View id.go
package helpers
import (
"github.com/dchest/uniuri"
validation "github.com/go-ozzo/ozzo-validation"
"github.com/go-ozzo/ozzo-validation/is"
)
// IDGeneratedLength defines the length of the id string
const IDGeneratedLength = 32
View how_i_write_microservice-part-1.md

How I write micro-services?

During my software developer experience, I have seen many bad practices as a code reviewer and collected a lot of tips to try to build better products. I want to focus on a specific part in order to prepare a enhanced Golang project template merging all these tips and practices.

What is a micro-service (again)?

My own personal definition

A micro-service is an internal autonomous observable immutable scalable self-contained unit of deployment of a non-monolithic style architecture. Each micro-service is responsible partially or completely of a part of a business problem, orchestrated and exposed by a Service Gateway.