Skip to content

Instantly share code, notes, and snippets.

@Soham3-1415
Soham3-1415 / pem_extractor.py
Created June 17, 2022 16:08
Extract PEM stuff from your file with this one easy script. Plug it into Unix find to extract all the PEM stuff from all the files.
#!/bin/python3
import sys,re,json
PEM = re.compile(b'(?P<whole>(?P<header>(?:-----)(?:(?:BEGIN) (?P<type>(?:[A-Z]+ )*(?:[A-Z]+)))(?:-----)(?:\n|\r|\r\n))(?P<inner_base64>(?:(?:(?:[0-9a-zA-Z\+\/]{4}){16})(?:\n|\r|\r\n))*(?:(?:(?:[A-Za-z0-9+\/]{4}){0,15})(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{4}))(?:\n|\r|\r\n))(?P<footer>(?:-----)(?:(?:END) (?P=type))(?:-----)))')
if not sys.argv[1]:
sys.exit(1)
filename = sys.argv[1]
@Soham3-1415
Soham3-1415 / gpg.conf
Created July 19, 2018 06:35
GPG Configuration
# cipher/digest settings
s2k-mode 3
s2k-count 65011712
s2k-cipher-algo AES256
s2k-digest-algo SHA512
personal-cipher-preferences AES256 AES192 AES
personal-digest-preferences SHA512 SHA384 SHA256
personal-compress-preferences BZIP2 ZLIB ZIP Uncompressed
cert-digest-algo SHA512
default-preference-list SHA512 SHA384 SHA256 AES256 AES192 AES BZIP2 ZLIB ZIP Uncompressed
@Soham3-1415
Soham3-1415 / keybase.md
Created March 8, 2018 03:28
My keybase proof

Keybase proof

I hereby claim:

  • I am soham3-1415 on github.
  • I am sohamroy (https://keybase.io/sohamroy) on keybase.
  • I have a public key ASBeV9IcWh22uSG9ABbbMfYS5_vckpSV5742zVtguIqYSAo

To claim this, I am signing this object: