Skip to content

Instantly share code, notes, and snippets.

View brianddk's full-sized avatar

brianddk

View GitHub Profile
x=wmic process where name="Wmic.exe" get parentprocessid
y=wmic process where ProcessId="x" list /format:table
@brianddk
brianddk / HowtoGpGsm
Created May 5, 2015 03:29
Howto GPG SM
Hybrid Install
GnuPG 2.1.3
Make a folder to hold 3 files (the installer, signature, certificate), preferably named "GnuPG" under "Downloads"
cert: https://www.gnupg.org/signature_key.html (save as signature_key.html)
sig: ftp://ftp.gnupg.org/gcrypt/binary/gnupg-w32-2.1.3_20150413.exe.sig
inst: ftp://ftp.gnupg.org/gcrypt/binary/gnupg-w32-2.1.3_20150413.exe
Gpg4Win 2.2.4
Make a folder to hold 3 files (the installer, signature, certificate), preferably named "gpg4win" under "Downloads"
@brianddk
brianddk / enc.ps1
Created May 7, 2015 05:50
Encoding depth of various RSA algorithms
function rsa_enc($pad, $bits, $bytes)
{
$in = "filein\rand_${bytes}.bin"
$inkey = "keyin\rsa_${bits}_priv.pem"
while ( -not ((Test-Path $in) -and (Test-Path $inkey)) )
{
Write-Host "Waiting...."
Start-Sleep -Seconds 10
}
@brianddk
brianddk / Notes.txt
Last active February 10, 2023 04:22
Extract Key Data from GPG
1) Create a key in Openssl (openssl genrsa)
2) Dump Key matter (https://www.openssl.org/docs/apps/asn1parse.html)
3) Import it into GpgSM (http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL)
4) Import into gpg (gpg --edit-key addkey {from existing fingerprint})
5) Dump Key matter (gpg --export {keyid} | gpg --list-packets --debug-all)
6) Export to OpenSSL (http://www.sysmic.org/dotclear/index.php?post/2010/03/24/Convert-keys-betweens-GnuPG%2C-OpenSsh-and-OpenSSL)
7) Dump Key matter (https://www.openssl.org/docs/apps/asn1parse.html)
PublicKey: https://tools.ietf.org/html/rfc2313#section-7.1
PrivateKey: https://tools.ietf.org/html/rfc2313#section-7.2
@brianddk
brianddk / secChat.txt
Created May 9, 2015 15:03
Secure Chat
OTR Jabber Client: https://play.google.com/store/apps/details?id=info.guardianproject.otr.app.im&hl=en
ECDH Client: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&hl=en
uPGP RSA: https://play.google.com/store/apps/details?id=com.woodkick.pgpsms&hl=en
And GnuPG: https://play.google.com/store/apps/details?id=org.thialfihar.android.apg
EC SMS: https://play.google.com/store/apps/details?id=com.woodkick.eccsms
@brianddk
brianddk / redirect.ps1
Created May 12, 2015 17:52
Raw Redirect in Powershell
$list = @()
$psi = New-Object System.Diagnostics.ProcessStartInfo
$psi.FileName = "C:\pcDrDan\Cygwin\bin\ls.exe"
$psi.Arguments = "-l *.txt".Split(" ")
$psi.WorkingDirectory = $pwd.Path
$psi.UseShellExecute = $false
$psi.ErrorDialog = $false
function CompressBuffer
{
Param(
[Parameter(Mandatory=$true)]
[Array]$Buffer
)
$inBuffer = [Byte[]] $Buffer
$staticBuffer = New-Object Byte[]($inBuffer.Length)
$inBuffer.CopyTo($staticBuffer, 0)
$compressedStream = New-Object IO.MemoryStream
@brianddk
brianddk / git_all_gist.py
Last active August 29, 2015 14:22
Get All Gist
# [rights] Copyright Dan B. (brianddk) 2015 https://github.com/brianddk
# [license] Licensed under Apache 2.0 https://www.apache.org/licenses/LICENSE-2.0
# [repo] https://gist.github.com/brianddk/5c2b65c05df100cd7c22
# [tips] 18MDTTiqPM8ZEo29Cig1wfGdkLNtvyorW5
import getpass
import json
import requests
hitBreak = False
user = raw_input("GitHub Username: ")
pas1 = getpass.getpass("GitHub Password: ")
@brianddk
brianddk / qr_enc_dec
Created June 2, 2015 06:11
QR Code enc/dec
ls -l | gzip | openssl enc -a | qrencode -o test.png; zbarimg --raw -q -Sdisable -Sqrcode.enable test.png | openssl enc -d -a | gzip -d
# ref: http://stackoverflow.com/questions/27233351
# cygwin-qrencode
# win32-zbarimg
@brianddk
brianddk / tipjar.md
Last active May 3, 2023 23:56
Tip Jar

brianddk's TipJar

None of my work in this space is sponsored, so other priorities take precedence. If you've found some of my samples or posts useful, or wish to place a bounty on a specific request, donations are welcome. But if you just want to give a thumbs up without putting any money down, consider one of the donation addresses listed in the testnet / valueless section or simply use one of my referral links below.

Mainnet / Production Coins

If you don't see a coin you would like to contribute, simply open an issue requesting I add it and I will. If you want to tip BAT or DONUT, I am accepting both at my Ethereum ERC20 address.

BTC Lightning Network https://tippin.me/@dkbriand