Skip to content

Instantly share code, notes, and snippets.

View redshiftzero's full-sized avatar
🐉
✧・゚: *✧・゚:* (⊃。•́‿•̀。)⊃ *:・゚✧*:・゚✧

redshiftzero redshiftzero

🐉
✧・゚: *✧・゚:* (⊃。•́‿•̀。)⊃ *:・゚✧*:・゚✧
View GitHub Profile
@redshiftzero
redshiftzero / pgp_to_jwk.py
Created April 14, 2020 15:09
converting armored gpg public key to JWK format - without private key
from authlib.common.encoding import int_to_base64
import json
import pgpy
# Input is PGP armored pubkey
key, _ = pgpy.PGPKey.from_file('key.asc')
n = int(key._key.keymaterial.n)
e = int(key._key.keymaterial.e)
@redshiftzero
redshiftzero / README.md
Created November 12, 2020 18:45
links to securedrop bot related things

Backport bot

The "Annoy contributors" bot

  • even longer ago i wrote a bot (while learning golang with a friend) for automating pinging contributors which the code for is here: https://github.com/securedrop-bot/securedrop-bot
  • this one was deployed using a GKE k8s cluster unnecessarily, also as a learning exercise
@redshiftzero
redshiftzero / test.jwk
Created November 13, 2020 17:41
to test A Thing
{"kty": "RSA", "n": "2BJmU8JIP2ZomBx4-fpjE4fSx4_RanotivLQ49F61oZ27ZxmRHQKiqZJXPYGZM7RuYPoq4rm30RvqHJ341PMRisEb7U8TBSTziJwkxK1QInp_uFDLHuerQb3RbJrWtngBfljmH1j7I-pX2u1o4kZz8Kgr9z8XBHq0OLicUALTNZiyRV2ZbkpUpjm5YRfB7L34EkEohxTnoEMhIZlKyR6hTyZHN5loPXD0Cx19r24B7_Hsy3R3L-tGWh4E-tB5kKFRwBeuyZZ-IaydUbYyETKLUUkr128UWbUzBmgcgoqU5WOfMdlytI4iC20zCL7PAxNb55yXzVmv0diF6R9onJW2AV1sFdDefQmprpyBwm85X2x896Y1PP2xME6FEHht28tSsQeL8o9DxfkM_QiBriIfWsBg1witNVrOlDcF0SFvgs6Pgr5WvZR5IQJdOdfWryACxj3NsBY2sDLs3q4WnBQm7m_7AI6ypbzO7FKRR-z9pZhlpQ2xzLV3Zux722ILz7EgRCzYnzZu6S7YNNhnutGze-QiajiGeBsIf1KZ9a1iVTNwfm-RmttJO-4C_i8ABiCXztFryN2JwYewhAVQ9XVFzK4u1Nzw7gB3fiCFGi-DJGTrltp_Zv-ILcjWeJBaaiMCBVcjA47yyn2a6QG6boytvVHrg2d4Ibkk1nudY_ID9U", "e": "AQAB"}
@redshiftzero
redshiftzero / pyo3tricks.md
Created December 7, 2020 21:01
alternative constructor for child class in pyo3
impl PreKeySignalMessage {
    #[staticmethod]
    pub fn try_from(data: &[u8]) -> PyResult<Py<PreKeySignalMessage>> {
        let upstream_data = match libsignal_protocol_rust::PreKeySignalMessage::try_from(data) {
            Ok(data) => data,
            Err(err) => return Err(SignalProtocolError::new_err(err)),
        };
        let ciphertext =
 libsignal_protocol_rust::CiphertextMessage::PreKeySignalMessage(upstream_data.clone());
@redshiftzero
redshiftzero / migration.py
Created April 2, 2024 20:41
migration script for poseidon377 parameter constants
import re
import sys
GENERATORS = {
0x01ae3a4617c510eac63b05c06ca1493b1a22d9f300f5138f1ef3622fba094800170b5d44300000008508c00000000001: 15,
0x12ab655e9a2ca55660b44d1e5c37b00159aa76fed00000010a11800000000001: 22,
0x4aad957a68b2955982d1347970dec005293a3afc43c8afeb95aee9ac33fd9ff: 5
}
% ./update-webcat-r2.sh
Current height: 153, publishing for height: 154
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.13s
Running `target/debug/felidae-publish print --height 154`
=== list.json contents ===
{
"block_height": 153,
"leaves": [
[
"canonical/.re.nym.testapp",