Skip to content

Instantly share code, notes, and snippets.

@tuansoibk
tuansoibk / cryptography-file-formats.md
Last active April 15, 2024 17:07
Cryptography material conversion and verification commands
  1. Introduction
  2. Standards
  3. Common combinations
  4. Conversion
  5. Verification/Inspection
  6. Tips for recognising

Introduction

It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.

@tuansoibk
tuansoibk / Program.cs
Created June 4, 2021 06:26
Generate practices for custom keyboard layouts, to be used with Kiran Typing Tutor's course
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace TypingPractice
{
internal class Program
{
private static readonly char[][] LeftKeys = new[]