Skip to content

Instantly share code, notes, and snippets.

leonklingele

Block or report user

Report or block leonklingele

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leonklingele
leonklingele / libsodium-php_issue.php
Last active Mar 11, 2017
crypto_aead_chacha20poly1305_decrypt triggers E_ERROR when decryption / authentication fails
View libsodium-php_issue.php
<?php
$crypto = new Crypt('cbe92e0557602e1bf9c05fffe8e54a809c1bdc5b3c3e2011b9153ce0ce672917', 'ok');
$enc = $crypto->encrypt('secretmessage');
// Here we prepend an 'a' -> Decryption should fail, i.e. return false
// It should NOT trigger an E_ERROR, as we can't handle that.
$dec = $crypto->decrypt('a' . $enc);
@leonklingele
leonklingele / openssl.cnf
Last active Feb 9, 2018
Useful openssl commands
View openssl.cnf
[ req ]
default_bits = 4096
default_md = sha256
default_keyfile = private.key
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_user_req
req_extensions = v3_user_req
[ req_distinguished_name ]
View build_nginx.sh
#!/usr/bin/env bash
set -eufo pipefail
main() {
# names of latest versions of each package
local NGINX_VERSION=1.17.5
local VERSION_NGINX=nginx-$NGINX_VERSION
local VERSION_LIBRESSL=libressl-3.0.2
local VERSION_PCRE=pcre-8.43
You can’t perform that action at this time.