Skip to content

Instantly share code, notes, and snippets.


tangsw cntsw

Block or report user

Report or block cntsw

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

Install 3scale self managed API gateway (openresty) in Mac OS-X

brew update
brew install pcre openssl

tar xzvf ngx_openresty-
cd ngx_openresty-
cntsw /
Created Mar 9, 2019
Rea Arithmetic Java Demo
public class RsaTest {
private static final BigInteger N1 = new BigInteger("-1"); // -1
public void test() {
int keyByteLen = 128 / 8;
BigInteger p = new BigInteger("fd6a04e98167dfa3", 16);
BigInteger q = new BigInteger("d6b703bcfe619b63", 16);
BigInteger n = p.multiply(q); // 0x282522173461889495699110463826178747657
BigInteger phi = p.add(N1).multiply(q.add(N1)); // phi = (q-1) * (p-1) d48bca9808d27e0d47237bf3e68cb204
BigInteger e = new BigInteger("65537");
cntsw /
Created Mar 9, 2019 — forked from dreikanter/
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

You can’t perform that action at this time.