Skip to content

Instantly share code, notes, and snippets.

View overheadhunter's full-sized avatar
🇺🇦

Sebastian Stenzel overheadhunter

🇺🇦
View GitHub Profile
@overheadhunter
overheadhunter / DecryptAlloc.java
Last active October 5, 2022 11:48
Example reproducing the issue described in https://bugs.openjdk.org/browse/JDK-8280703
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.nio.ByteBuffer;
import java.security.GeneralSecurityException;
/**
* This demonstrates a memory allocation problem in com.sun.crypto.provider.CipherCore.
* <p>
* To reproduce the issue, run this class using:
@overheadhunter
overheadhunter / concatKdf.ts
Last active July 4, 2022 18:40
TypeScript Key Derivation Functions ANSI-X9.63 and NIST SP 800-56A Rev. 2 ConcatKDF
/**
* KDF as defined in <a href="https://doi.org/10.6028/NIST.SP.800-56Ar2">NIST SP 800-56A Rev. 2 Section 5.8.1</a> using SHA-256
*
* @param z A shared secret
* @param keyDataLen Desired key length (in bytes)
* @param otherInfo Concatenated form of AlgorithmID || PartyUInfo || PartyVInfo {|| SuppPubInfo }{|| SuppPrivInfo }
* @returns key data
*/
public static async concatKDF(z: Uint8Array, keyDataLen: number, otherInfo: Uint8Array): Promise<Uint8Array> {
const hashLen = 32; // output length of SHA-256
@overheadhunter
overheadhunter / BenchmarkTest.java
Created July 15, 2021 10:58
Benchmark of different strlen() variation
import jdk.incubator.foreign.MemoryAccess;
import jdk.incubator.foreign.MemorySegment;
import org.openjdk.jmh.annotations.Benchmark;
import org.openjdk.jmh.annotations.BenchmarkMode;
import org.openjdk.jmh.annotations.Fork;
import org.openjdk.jmh.annotations.Mode;
import org.openjdk.jmh.annotations.OutputTimeUnit;
import org.openjdk.jmh.annotations.Warmup;
import org.openjdk.jmh.infra.Blackhole;
@overheadhunter
overheadhunter / docker-compose.yml
Last active November 7, 2018 15:59
Cryptomator Server PWD Stack
version: '3.4'
services:
wildfly:
image: skymatic/defendor:0.4.0
environment:
- POSTGRES_USER=defendor
- POSTGRES_PASSWORD=notASecurePassword
- POSTGRES_DB=defendor
- SYSLOG_HOST=syslog
@overheadhunter
overheadhunter / Dockerfile
Last active July 12, 2017 18:16
Discourse 1.8.3 Dockerfile
FROM ruby:2.4
WORKDIR /usr/src/app
ENV RAILS_ENV=production \
RUBY_GC_MALLOC_LIMIT=90000000 \
RUBY_GLOBAL_METHOD_CACHE_SIZE=131072 \
DISCOURSE_DB_HOST=postgres \
DISCOURSE_REDIS_HOST=redis \
DISCOURSE_SERVE_STATIC_ASSETS=true

Keybase proof

I hereby claim:

  • I am overheadhunter on github.
  • I am overheadhunter (https://keybase.io/overheadhunter) on keybase.
  • I have a public key whose fingerprint is CBC2 460B 7BB8 F9E6 54F5 DDBC 667B 866E A824 0A09

To claim this, I am signing this object:

@overheadhunter
overheadhunter / Cryptomator_CLA.md
Last active August 24, 2017 10:48 — forked from CLAassistant/SAP_CLA
Cryptomator Individual Contributor License Agreement

Cryptomator Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by the Cryptomator developers (Tobias Hagemann, Markus Kreusch and Sebastian Stenzel) (“Cryptomator”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Cryptomator in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact support@cryptomator.org.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You he

@overheadhunter
overheadhunter / launcher.cpp
Last active May 10, 2016 10:50
Linux JavaFX Launcher with fixed GetProgramPath()
/*
* Copyright (c) 2014, Oracle and/or its affiliates.
* All rights reserved. Use is subject to license terms.
*
* This file is available and licensed under the following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
@overheadhunter
overheadhunter / AesBenchmark.java
Created November 8, 2015 00:03
Benchmarking GCM vs CTR+HMAC in Java
import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
@overheadhunter
overheadhunter / maven-daggerfx.log
Created August 8, 2015 21:32
mvn clean compile -X (Using Maven 3.3.1)
Apache Maven 3.3.1 (cab6659f9874fa96462afef40fcf6bc033d58c1c; 2015-03-13T21:10:27+01:00)
Maven home: /usr/local/Cellar/maven/3.3.1/libexec
Java version: 1.8.0_51, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.4", arch: "x86_64", family: "mac"
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
[DEBUG] Imported: javax.enterprise.inject.* < plexus.core
[DEBUG] Imported: javax.enterprise.util.* < plexus.core