Skip to content

Instantly share code, notes, and snippets.

@mnicky
mnicky / mvnc.sh
Created June 4, 2014 12:55 — forked from japgolly/mvnc.sh
#!/bin/bash
RESET="\e[0m"
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
MAGENTA="\e[0;35m"
CYAN="\e[0;36m"
@mnicky
mnicky / gist:7e0e21b8dfa07ee9ba57
Created December 18, 2015 10:04 — forked from grugq/gist:7713916
The text from: http://dee.su/uploads/baal.html On Underground Communications
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Undercover communication
It should be obvious by now, that the only way to communicate
stealthily and securely is to avoid raising suspicion to the
level at which the authorities might consider it worthwhile
to put you under active surveillance (e.g., park a van with
TEMPEST equipment by your apartment).

Symmetric Encryption

The only way to encrypt today is authenticated encryption, or "AEAD". ChaCha20-Poly1305 is faster in software than AES-GCM. AES-GCM will be faster than ChaCha20-Poly1305 with AES-NI. Poly1305 is also easier than GCM for library designers to implement safely. AES-GCM is the industry standard.

Use, in order of preference:

  1. The NaCl/libsodium default
@mnicky
mnicky / Result.java
Created January 26, 2019 23:46
Result monad for Java (WIP)
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
import java.util.NoSuchElementException;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
@mnicky
mnicky / ChainingImplicits.scala
Created May 4, 2021 15:08
Chaining implicits for Scala < 2.13
package utils
object ChainingImplicits {
/**
* Defines chaining operators similar to pipe() and tap() from Scala 2.13.
*
* Example usage:
* <pre>
* import utils.ChainingImplicits._