wget https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.11.tar.bz2
tar xf gnupg-2.1.11.tar.bz2
pushd gnupg-2.1.11
git clone git://git.gnupg.org/libgcrypt.git
pushd libgcrypt
./autogen.sh
./configure --prefix=$PWD --disable-doc
make
| wget http://dl-ssl.google.com/android/repository/android-19_r01.zip | |
| unzip -p android-19_r01.zip android-*/build.prop | grep "ro.build.id" | tail -c+13 | |
| # => KRT16L | |
| git clone https://github.com/android/platform_build; cd platform_build | |
| git log --oneline --all --no-abbrev --grep=KRT16L | head -c40 | xargs git describe | |
| # => android-4.4_r0.9 |
| require 'openssl' | |
| ec = OpenSSL::PKey::EC.new('secp256k1') | |
| # ec.generate_key | |
| ec.private_key = "85BDCD4EF6319F9996D5499BD011E6094224CD1B9C87599E854F4E4EA408EFA6".to_i(16) | |
| ec.public_key = ec.group.generator.mul(ec.private_key) |
| # trace debug-log macro | |
| sudo dtrace -qn 'security_debug*:::log { printf("[%s] %s\n", copyinstr(arg0), copyinstr(arg1)); }' | |
| # restart securityd | |
| sudo launchctl unload /System/Library/LaunchDaemons/com.apple.securityd.plist && | |
| sudo launchctl load /System/Library/LaunchDaemons/com.apple.securityd.plist |
| In /System/Library/LaunchDaemons/com.apple.securityd.plist, this apparently *won't* keep pcscd alive forever: | |
| <array> | |
| <string>/usr/sbin/securityd</string> | |
| <string>-i</string> | |
| <string>-s</string> | |
| <string>on</string> | |
| </array> | |
| This is despite a comment in pcscmonitor.h that says it should "keep pcscd running at all times" | |
| Oh well. |
| require 'timeout' | |
| loop do | |
| pid = fork | |
| if pid.nil? | |
| exec("youtube-dl https://www.youtube.com/playlist?list=PL47F408D36D4CF129") | |
| else | |
| begin | |
| Timeout::timeout(15 * 60) { |
| sudo syslog -w -k Sender com.apple.ifdreader |
| # ruby prime256v1.rb < secp256k1_private_key.pem > prime256v1_private_key.pem | |
| require 'openssl' | |
| ec = OpenSSL::PKey::EC.new('prime256v1') | |
| ec.private_key = OpenSSL::PKey::EC.new(ARGF.read).private_key | |
| ec.public_key = ec.group.generator.mul(ec.private_key) | |
| print ec.to_pem |
| #!/usr/bin/env ruby | |
| # create temporary auth key first via gui, then export your whole keyring and modify it | |
| require 'digest' | |
| unpatched = File.read 'temp_auth.key' | |
| unpatched_bytes = unpatched.bytes |
wget https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-2.1.11.tar.bz2
tar xf gnupg-2.1.11.tar.bz2
pushd gnupg-2.1.11
git clone git://git.gnupg.org/libgcrypt.git
pushd libgcrypt
./autogen.sh
./configure --prefix=$PWD --disable-doc
make
| #!/usr/bin/env ruby | |
| require 'openssl' | |
| require 'tempfile' | |
| OpenSSL::PKey::EC.send :alias_method, :private?, :private_key? | |
| key = OpenSSL::PKey::EC.new('secp256k1') | |
| key.generate_key |