- You'll need to install OpenSSL to create and sign certificates.
- Linux:
sudo apt-get install openssl
- MacOS:
brew install openssl
- Linux:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static string MD5Hash(string toHash) | |
{ | |
string hashed; | |
using (MD5 md5 = MD5.Create()) | |
{ | |
hashed = string.Join(string.Empty, md5.ComputeHash(Encoding.UTF8.GetBytes(toHash)).Select(b => b.ToString("x2"))); | |
} | |
return hashed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
X509Certificate2 cert = new X509Certificate2(@"KEY.pfx", "pfxPassword", X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet); | |
RSACryptoServiceProvider provider = (RSACryptoServiceProvider) cert.PrivateKey; | |
byte[] array = provider.ExportCspBlob(!provider.PublicOnly); | |
using (FileStream fs = new FileStream("FileName.snk", FileMode.Create, FileAccess.Write)) | |
{ | |
fs.Write(array, 0, array.Length); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Security.Cryptography; | |
using System.Text; | |
namespace Crtypto | |
{ | |
class Program | |
{ | |
static void Main(string[] args) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.14-alpine | |
COPY . /go/src/app | |
WORKDIR /go/src/app | |
RUN go get -v -d | |
RUN go install | |
CMD ["app"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# By: Brady Shea - 10FEB2020 | |
# | |
# Usage (ip4 only): | |
# geoip2lookup IP_ADDRESS | |
# | |
# ** Install GeoIP Tool and Updater ** | |
# | |
# sudo add-apt-repository ppa:maxmind/ppa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Print usage | |
function usage { | |
echo -n "$(basename $0) CIDR... | |
$(basename $0) [OPTION] CIDR... | |
This script prints the ip range or full list of ip addresses for one or more CIDR. | |
Options: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ul.tree, ul.tree ul { | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
ul.tree ul { | |
margin-left: 10px; | |
} | |
ul.tree li { | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bottle import default_app, route | |
import hashlib | |
import ctypes | |
import secrets | |
# Copyright (c) 2005-2023, NumPy Developers. | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are |
These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.
OpenSSL has a variety of commands that can be used to operate on private
key files, some of which are specific to RSA (e.g. openssl rsa
and
openssl genrsa
) or which have other limitations. Here we always use
OlderNewer